• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.tools.idea.validator;
18 
19 import com.android.tools.layoutlib.annotations.Nullable;
20 
21 import com.google.android.apps.common.testing.accessibility.framework.Parameters;
22 import com.google.android.apps.common.testing.accessibility.framework.uielement.AccessibilityHierarchyAndroid;
23 
24 /**
25  * Hierarchical data required for running the ATF scanner checks.
26  * Creation of the hierarchical data is pretty quick.
27  */
28 public class ValidatorHierarchy {
29     /** Contains meta data (such as src map) that is required for building result */
30     public @Nullable ValidatorResult.Builder mBuilder = null;
31     /** Contains view hierarchy data related to a11y */
32     public @Nullable AccessibilityHierarchyAndroid mView = null;
33     /** Contains screen capture of the view */
34     public @Nullable Parameters mParameters = null;
35 
36     public @Nullable String mErrorMessage = null;
37 
38     /** Returns true if hierarchical data is available to build results. */
isHierarchyBuilt()39     public boolean isHierarchyBuilt() {
40         return mBuilder != null && mView != null;
41     }
42 
43 }
44