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.FeatureImpl; 24 import org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement; 25 26 30 public class FeatureInfo extends ElementInfo { 31 public static final int STATIC_INITIALIZER_TYPE = ASTreeTypes.STATIC_INITIALIZER; 32 public static final int INSTANCE_INITIALIZER_TYPE = ASTreeTypes.INSTANCE_INITIALIZER; 33 public static final int ENUM_CONSTANT_TYPE = ASTreeTypes.ENUM_CONSTANT; 34 35 public final int modifiers; 36 public final AnnotationInfo[] annotations; 37 38 public FeatureInfo(ASTree tree, int infoType, String name, int modifiers, AnnotationInfo[] annotations) { 39 super(tree, infoType, name); 40 this.modifiers = modifiers; 41 this.annotations = annotations == null ? EMPTY_ANNOTATIONS: annotations; 42 } 43 44 public void doAttribution(FeatureImpl parent) { 45 assert parent.getElementInfo() == this; 46 ((ResourceInfo) resource.getElementInfo()).doAttribution(parent); 47 } 48 49 public ASTree getTypeAST(SemiPersistentElement owner) { 50 ASTree tree = owner.getASTree(); 51 if (tree != null) { 52 return tree.getSubTrees()[1]; 53 } 54 return null; 55 } 56 } 57 | Popular Tags |