1 11 package org.eclipse.jdt.core.dom; 12 13 import java.util.ArrayList ; 14 import java.util.List ; 15 16 31 public class AnonymousClassDeclaration extends ASTNode { 32 33 37 public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = 38 new ChildListPropertyDescriptor(AnonymousClassDeclaration.class, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); 40 45 private static final List PROPERTY_DESCRIPTORS; 46 47 static { 48 List properyList = new ArrayList (2); 49 createPropertyList(AnonymousClassDeclaration.class, properyList); 50 addProperty(BODY_DECLARATIONS_PROPERTY, properyList); 51 PROPERTY_DESCRIPTORS = reapPropertyList(properyList); 52 } 53 54 65 public static List propertyDescriptors(int apiLevel) { 66 return PROPERTY_DESCRIPTORS; 67 } 68 69 73 private ASTNode.NodeList bodyDeclarations = 74 new ASTNode.NodeList(BODY_DECLARATIONS_PROPERTY); 75 76 87 AnonymousClassDeclaration(AST ast) { 88 super(ast); 89 } 90 91 94 final List internalStructuralPropertiesForType(int apiLevel) { 95 return propertyDescriptors(apiLevel); 96 } 97 98 101 final List internalGetChildListProperty(ChildListPropertyDescriptor property) { 102 if (property == BODY_DECLARATIONS_PROPERTY) { 103 return bodyDeclarations(); 104 } 105 return super.internalGetChildListProperty(property); 107 } 108 109 112 final int getNodeType0() { 113 return ANONYMOUS_CLASS_DECLARATION; 114 } 115 116 119 ASTNode clone0(AST target) { 120 AnonymousClassDeclaration result = new AnonymousClassDeclaration(target); 121 result.setSourceRange(this.getStartPosition(), this.getLength()); 122 result.bodyDeclarations().addAll( 123 ASTNode.copySubtrees(target, bodyDeclarations())); 124 return result; 125 } 126 127 130 final boolean subtreeMatch0(ASTMatcher matcher, Object other) { 131 return matcher.match(this, other); 133 } 134 135 138 void accept0(ASTVisitor visitor) { 139 boolean visitChildren = visitor.visit(this); 140 if (visitChildren) { 141 acceptChildren(visitor, bodyDeclarations); 143 } 144 visitor.endVisit(this); 145 } 146 147 154 public List bodyDeclarations() { 155 return this.bodyDeclarations; 156 } 157 158 169 public ITypeBinding resolveBinding() { 170 return this.ast.getBindingResolver().resolveType(this); 171 } 172 173 176 int memSize() { 177 return BASE_NODE_SIZE + 4; 179 } 180 181 184 int treeSize() { 185 return 186 memSize() 187 + this.bodyDeclarations.listSize(); 188 } 189 } 190 | Popular Tags |