<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class ImportDeclaration extends ASTNode { public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( ImportDeclaration . class , "name" , Name . class , MANDATORY , NO_CYCLE_RISK ) ; public static final SimplePropertyDescriptor ON_DEMAND_PROPERTY = new SimplePropertyDescriptor ( ImportDeclaration . class , "onDemand" , boolean . class , MANDATORY ) ; public static final SimplePropertyDescriptor STATIC_PROPERTY = new SimplePropertyDescriptor ( ImportDeclaration . class , "static" , boolean . class , MANDATORY ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; static { List properyList = new ArrayList ( 3 ) ; createPropertyList ( ImportDeclaration . class , properyList ) ; addProperty ( NAME_PROPERTY , properyList ) ; addProperty ( ON_DEMAND_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS_2_0 = reapPropertyList ( properyList ) ; properyList = new ArrayList ( 4 ) ; createPropertyList ( ImportDeclaration . class , properyList ) ; addProperty ( STATIC_PROPERTY , properyList ) ; addProperty ( NAME_PROPERTY , properyList ) ; addProperty ( ON_DEMAND_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS_3_0 = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { if ( apiLevel == AST . JLS2_INTERNAL ) { return PROPERTY_DESCRIPTORS_2_0 ; } else { return PROPERTY_DESCRIPTORS_3_0 ; } } private Name importName = null ; private boolean onDemand = false ; private boolean isStatic = false ; ImportDeclaration ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final boolean internalGetSetBooleanProperty ( SimplePropertyDescriptor property , boolean get , boolean value ) { if ( property == ON_DEMAND_PROPERTY ) { if ( get ) { return isOnDemand ( ) ; } else { setOnDemand ( value ) ; return false ; } } if ( property == STATIC_PROPERTY ) { if ( get ) { return isStatic ( ) ; } else { setStatic ( value ) ; return false ; } } return super . internalGetSetBooleanProperty ( property , get , value ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == NAME_PROPERTY ) { if ( get ) { return getName ( ) ; } else { setName ( ( Name ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return IMPORT_DECLARATION ; } ASTNode clone0 ( AST target ) { ImportDeclaration result = new ImportDeclaration ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setOnDemand ( isOnDemand ( ) ) ; if ( this . ast . apiLevel >= AST . JLS3 ) { result . setStatic ( isStatic ( ) ) ; } result . setName ( ( Name ) getName ( ) . 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 , getName ( ) ) ; } visitor . endVisit ( this ) ; } public Name getName ( ) { if ( this . importName == null ) { synchronized ( this ) { if ( this . importName == null ) { preLazyInit ( ) ; this . importName = this . ast . newQualifiedName ( new SimpleName ( this . ast ) , new SimpleName ( this . ast ) ) ; postLazyInit ( this . importName , NAME_PROPERTY ) ; } } } return this . importName ; } public void setName ( Name name ) { if ( name == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . importName ; preReplaceChild ( oldChild , name , NAME_PROPERTY ) ; this . importName = name ; postReplaceChild ( oldChild , name , NAME_PROPERTY ) ; } public boolean isOnDemand ( ) { return this . onDemand ; } public void setOnDemand ( boolean onDemand ) { preValueChange ( ON_DEMAND_PROPERTY ) ; this . onDemand = onDemand ; postValueChange ( ON_DEMAND_PROPERTY ) ; } public boolean isStatic ( ) { unsupportedIn2 ( ) ; return this . isStatic ; } public void setStatic ( boolean isStatic ) { unsupportedIn2 ( ) ; preValueChange ( STATIC_PROPERTY ) ; this . isStatic = isStatic ; postValueChange ( STATIC_PROPERTY ) ; } public IBinding resolveBinding ( ) { return this . ast . getBindingResolver ( ) . resolveImport ( this ) ; } int memSize ( ) { return BASE_NODE_SIZE + 3 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . importName == null ? 0 : getName ( ) . treeSize ( ) ) ; } } </s>