1 11 package org.eclipse.jdt.core.dom; 12 13 25 public abstract class Annotation extends Expression implements IExtendedModifier { 26 27 33 abstract ChildPropertyDescriptor internalTypeNameProperty(); 34 35 41 public final ChildPropertyDescriptor getTypeNameProperty() { 42 return internalTypeNameProperty(); 43 } 44 45 51 static final ChildPropertyDescriptor internalTypeNamePropertyFactory(Class nodeClass) { 52 return new ChildPropertyDescriptor(nodeClass, "typeName", Name.class, MANDATORY, NO_CYCLE_RISK); } 54 55 59 Name typeName = null; 60 61 70 Annotation(AST ast) { 71 super(ast); 72 } 73 74 77 public boolean isModifier() { 78 return false; 79 } 80 81 84 public boolean isAnnotation() { 85 return true; 86 } 87 88 93 public Name getTypeName() { 94 if (this.typeName == null) { 95 synchronized (this) { 97 if (this.typeName == null) { 98 preLazyInit(); 99 this.typeName = new SimpleName(this.ast); 100 postLazyInit(this.typeName, internalTypeNameProperty()); 101 } 102 } 103 } 104 return this.typeName; 105 } 106 107 117 public void setTypeName(Name typeName) { 118 if (typeName == null) { 119 throw new IllegalArgumentException (); 120 } 121 ChildPropertyDescriptor p = internalTypeNameProperty(); 122 ASTNode oldChild = this.typeName; 123 preReplaceChild(oldChild, typeName, p); 124 this.typeName = typeName; 125 postReplaceChild(oldChild, typeName, p); 126 } 127 128 135 public boolean isNormalAnnotation() { 136 return (this instanceof NormalAnnotation); 137 } 138 139 146 public boolean isMarkerAnnotation() { 147 return (this instanceof MarkerAnnotation); 148 } 149 150 157 public boolean isSingleMemberAnnotation() { 158 return (this instanceof SingleMemberAnnotation); 159 } 160 161 164 int memSize() { 165 return BASE_NODE_SIZE + 1 * 4; 166 } 167 } 168 169 | Popular Tags |