1 11 package org.eclipse.jdt.core.dom; 12 13 import java.util.ArrayList ; 14 import java.util.List ; 15 16 28 public final class MarkerAnnotation extends Annotation { 29 30 33 public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = 34 internalTypeNamePropertyFactory(MarkerAnnotation.class); 35 36 41 private static final List PROPERTY_DESCRIPTORS; 42 43 static { 44 List propertyList = new ArrayList (2); 45 createPropertyList(MarkerAnnotation.class, propertyList); 46 addProperty(TYPE_NAME_PROPERTY, propertyList); 47 PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); 48 } 49 50 58 public static List propertyDescriptors(int apiLevel) { 59 return PROPERTY_DESCRIPTORS; 60 } 61 62 72 MarkerAnnotation(AST ast) { 73 super(ast); 74 unsupportedIn2(); 75 } 76 77 80 final List internalStructuralPropertiesForType(int apiLevel) { 81 return propertyDescriptors(apiLevel); 82 } 83 84 87 final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { 88 if (property == TYPE_NAME_PROPERTY) { 89 if (get) { 90 return getTypeName(); 91 } else { 92 setTypeName((Name) child); 93 return null; 94 } 95 } 96 return super.internalGetSetChildProperty(property, get, child); 98 } 99 100 103 final ChildPropertyDescriptor internalTypeNameProperty() { 104 return TYPE_NAME_PROPERTY; 105 } 106 107 110 final int getNodeType0() { 111 return MARKER_ANNOTATION; 112 } 113 114 117 ASTNode clone0(AST target) { 118 MarkerAnnotation result = new MarkerAnnotation(target); 119 result.setSourceRange(this.getStartPosition(), this.getLength()); 120 result.setTypeName((Name) ASTNode.copySubtree(target, getTypeName())); 121 return result; 122 } 123 124 127 final boolean subtreeMatch0(ASTMatcher matcher, Object other) { 128 return matcher.match(this, other); 130 } 131 132 135 void accept0(ASTVisitor visitor) { 136 boolean visitChildren = visitor.visit(this); 137 if (visitChildren) { 138 acceptChild(visitor, getTypeName()); 140 } 141 visitor.endVisit(this); 142 } 143 144 147 int memSize() { 148 return super.memSize(); 149 } 150 151 154 int treeSize() { 155 return 156 memSize() 157 + (this.typeName == null ? 0 : getTypeName().treeSize()); 158 } 159 } 160 | Popular Tags |