Home | History | Annotate | Download | only in layout
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
      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 package com.android.ide.common.layout;
     17 
     18 import com.android.ide.common.api.IAttributeInfo;
     19 
     20 import java.util.EnumSet;
     21 
     22 /** Test/mock implementation of {@link IAttributeInfo} */
     23 public class TestAttributeInfo implements IAttributeInfo {
     24     private final String mName;
     25     private final EnumSet<Format> mFormats;
     26     private final String mDefinedBy;
     27     private final String[] mEnumValues;
     28     private final String[] mFlagValues;
     29     private final String mJavadoc;
     30 
     31     public TestAttributeInfo(String name) {
     32         this(name, null, null, null, null, null);
     33     }
     34 
     35     public TestAttributeInfo(String name, EnumSet<Format> formats, String definedBy,
     36             String[] enumValues, String[] flagValues, String javadoc) {
     37         super();
     38         this.mName = name;
     39         this.mFormats = formats;
     40         this.mDefinedBy = definedBy;
     41         this.mEnumValues = enumValues;
     42         this.mFlagValues = flagValues;
     43         this.mJavadoc = javadoc;
     44     }
     45 
     46     @Override
     47     public String getDeprecatedDoc() {
     48         return null;
     49     }
     50 
     51     @Override
     52     public String[] getEnumValues() {
     53         return mEnumValues;
     54     }
     55 
     56     @Override
     57     public String[] getFlagValues() {
     58         return mFlagValues;
     59     }
     60 
     61     @Override
     62     public EnumSet<Format> getFormats() {
     63         return mFormats;
     64     }
     65 
     66     @Override
     67     public String getJavaDoc() {
     68         return mJavadoc;
     69     }
     70 
     71     @Override
     72     public String getName() {
     73         return mName;
     74     }
     75 
     76     @Override
     77     public String getDefinedBy() {
     78         return mDefinedBy;
     79     }
     80 }