<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class TypeDeclarationStatement extends Statement { public static final ChildPropertyDescriptor TYPE_DECLARATION_PROPERTY = new ChildPropertyDescriptor ( TypeDeclarationStatement . class , "" , TypeDeclaration . class , MANDATORY , CYCLE_RISK ) ; public static final ChildPropertyDescriptor DECLARATION_PROPERTY = new ChildPropertyDescriptor ( TypeDeclarationStatement . class , "declaration" , AbstractTypeDeclaration . class , MANDATORY , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; static { List propertyList = new ArrayList ( 2 ) ; createPropertyList ( TypeDeclarationStatement . class , propertyList ) ; addProperty ( TYPE_DECLARATION_PROPERTY , propertyList ) ; PROPERTY_DESCRIPTORS_2_0 = reapPropertyList ( propertyList ) ; propertyList = new ArrayList ( 2 ) ; createPropertyList ( TypeDeclarationStatement . class , propertyList ) ; addProperty ( DECLARATION_PROPERTY , propertyList ) ; PROPERTY_DESCRIPTORS_3_0 = reapPropertyList ( propertyList ) ; } public static List propertyDescriptors ( int apiLevel ) { if ( apiLevel == AST . JLS2_INTERNAL ) { return PROPERTY_DESCRIPTORS_2_0 ; } else { return PROPERTY_DESCRIPTORS_3_0 ; } } private AbstractTypeDeclaration typeDecl = null ; private ChildPropertyDescriptor typeDeclProperty ( ) { if ( getAST ( ) . apiLevel ( ) == AST . JLS2_INTERNAL ) { return TYPE_DECLARATION_PROPERTY ; } else { return DECLARATION_PROPERTY ; } } TypeDeclarationStatement ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == TYPE_DECLARATION_PROPERTY ) { if ( get ) { return getTypeDeclaration ( ) ; } else { setTypeDeclaration ( ( TypeDeclaration ) child ) ; return null ; } } if ( property == DECLARATION_PROPERTY ) { if ( get ) { return getDeclaration ( ) ; } else { setDeclaration ( ( AbstractTypeDeclaration ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return TYPE_DECLARATION_STATEMENT ; } ASTNode clone0 ( AST target ) { TypeDeclarationStatement result = new TypeDeclarationStatement ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . copyLeadingComment ( this ) ; result . setDeclaration ( ( AbstractTypeDeclaration ) getDeclaration ( ) . clone ( target ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { return matcher . match ( this , other ) ; } void accept0 ( ASTVisitor visitor ) { boolean visitChildren = visitor . visit ( this ) ; if ( visitChildren ) { acceptChild ( visitor , getDeclaration ( ) ) ; } visitor . endVisit ( this ) ; } public AbstractTypeDeclaration getDeclaration ( ) { if ( this . typeDecl == null ) { synchronized ( this ) { if ( this . typeDecl == null ) { preLazyInit ( ) ; this . typeDecl = new TypeDeclaration ( this . ast ) ; postLazyInit ( this . typeDecl , typeDeclProperty ( ) ) ; } } } return this . typeDecl ; } public void setDeclaration ( AbstractTypeDeclaration decl ) { if ( decl == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . typeDecl ; ChildPropertyDescriptor typeDeclProperty = typeDeclProperty ( ) ; preReplaceChild ( oldChild , decl , typeDeclProperty ) ; this . typeDecl = decl ; postReplaceChild ( oldChild , decl , typeDeclProperty ) ; } public TypeDeclaration getTypeDeclaration ( ) { return internalGetTypeDeclaration ( ) ; } final TypeDeclaration internalGetTypeDeclaration ( ) { supportedOnlyIn2 ( ) ; return ( TypeDeclaration ) getDeclaration ( ) ; } public void setTypeDeclaration ( TypeDeclaration decl ) { internalSetTypeDeclaration ( decl ) ; } final void internalSetTypeDeclaration ( TypeDeclaration decl ) { supportedOnlyIn2 ( ) ; setDeclaration ( decl ) ; } public ITypeBinding resolveBinding ( ) { AbstractTypeDeclaration d = getDeclaration ( ) ; if ( d instanceof TypeDeclaration ) { return ( ( TypeDeclaration ) d ) . resolveBinding ( ) ; } else if ( d instanceof AnnotationTypeDeclaration ) { return ( ( AnnotationTypeDeclaration ) d ) . resolveBinding ( ) ; } else { return null ; } } int memSize ( ) { return super . memSize ( ) + 1 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . typeDecl == null ? 0 : getDeclaration ( ) . treeSize ( ) ) ; } } </s>