1 19 package org.netbeans.modules.javacore.parser; 20 21 import org.netbeans.lib.java.parser.ASTree; 22 import org.netbeans.lib.java.parser.ASTreeTypes; 23 import org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement; 24 25 29 public class FieldInfo extends FeatureInfo { 30 public static final int FIELD_TYPE = ASTreeTypes.FIELD_DECLARATION; 31 32 public static final int SINGLE_FIELD_INDEX = -1; 33 34 public final TypeRef type; public final int index; 36 37 public FieldInfo(ASTree tree, int infoType, String name, int modifiers, 38 TypeRef type, int index, AnnotationInfo[] annotations) 39 { 40 super(tree, infoType, name, modifiers, annotations); 41 this.type = type; 42 this.index = index; 43 } 44 45 public ASTree getTypeAST(SemiPersistentElement owner) { 46 ASTree tree = owner.getASTree(); 47 if (tree != null && tree.getType()!=ASTreeTypes.VARIABLE_DECLARATOR) { 48 return tree.getSubTrees()[1]; 49 } 50 return null; 51 } 52 53 } 54 | Popular Tags |