public static ASTNode nodeClassForType(int nodeType,AST ast){
switch (nodeType) {
case ANNOTATION_TYPE_DECLARATION:
    return new AnnotationTypeDeclaration(ast);
case ANNOTATION_TYPE_MEMBER_DECLARATION:
  return new AnnotationTypeMemberDeclaration(ast);
case ANONYMOUS_CLASS_DECLARATION:
return new AnonymousClassDeclaration(ast);
case ARRAY_ACCESS:
return new ArrayAccess(ast);
case ARRAY_CREATION:
return new ArrayCreation(ast);
case ARRAY_INITIALIZER:
return new ArrayInitializer(ast);
case ARRAY_TYPE:
return new ArrayType(ast);
case ASSERT_STATEMENT:
return new AssertStatement(ast);
case ASSIGNMENT:
return new Assignment(ast);
case BLOCK:
return new Block(ast);
case BLOCK_COMMENT:
return new BlockComment(ast);
case BOOLEAN_LITERAL:
return new BooleanLiteral(ast);
case BREAK_STATEMENT:
return new BreakStatement(ast);
case CAST_EXPRESSION:
return new CastExpression(ast);
case CATCH_CLAUSE:
return new CatchClause(ast);
case CHARACTER_LITERAL:
return new CharacterLiteral(ast);
case CLASS_INSTANCE_CREATION:
return new ClassInstanceCreation(ast);
case COMPILATION_UNIT:
return new CompilationUnit(ast);
case CONDITIONAL_EXPRESSION:
return new ConditionalExpression(ast);
case CONSTRUCTOR_INVOCATION:
return new ConstructorInvocation(ast);
case CONTINUE_STATEMENT:
return new ContinueStatement(ast);
case UNION_TYPE:
return new UnionType(ast);
case DO_STATEMENT:
return new DoStatement(ast);
case EMPTY_STATEMENT:
return new EmptyStatement(ast);
case ENHANCED_FOR_STATEMENT:
return new EnhancedForStatement(ast);
case ENUM_CONSTANT_DECLARATION:
return new EnumConstantDeclaration(ast);
case ENUM_DECLARATION:
return new EnumDeclaration(ast);
case EXPRESSION_STATEMENT:
return new ExpressionStatement(ast);
case FIELD_ACCESS:
return new FieldAccess(ast);
case FIELD_DECLARATION:
return new FieldDeclaration(ast);
case FOR_STATEMENT:
return new ForStatement(ast);
case IF_STATEMENT:
return new IfStatement(ast);
case IMPORT_DECLARATION:
return new ImportDeclaration(ast);
case INFIX_EXPRESSION:
return new InfixExpression(ast);
case INITIALIZER:
return new Initializer(ast);
case INSTANCEOF_EXPRESSION:
return new InstanceofExpression(ast);
case JAVADOC:
return new Javadoc(ast);
case LABELED_STATEMENT:
return new LabeledStatement(ast);
case LINE_COMMENT:
return new LineComment(ast);
case MARKER_ANNOTATION:
return new MarkerAnnotation(ast);
case MEMBER_REF:
return new MemberRef(ast);
case MEMBER_VALUE_PAIR:
return new MemberValuePair(ast);
case METHOD_DECLARATION:
return new MethodDeclaration(ast);
case METHOD_INVOCATION:
return new MethodInvocation(ast);
case METHOD_REF:
return new MethodRef(ast);
case METHOD_REF_PARAMETER:
return new MethodRefParameter(ast);
case MODIFIER:
return new Modifier(ast);
case NORMAL_ANNOTATION:
return new NormalAnnotation(ast);
case NULL_LITERAL:
return new NullLiteral(ast);
case NUMBER_LITERAL:
return new NumberLiteral(ast);
case PACKAGE_DECLARATION:
return new PackageDeclaration(ast);
case PARAMETERIZED_TYPE:
return new ParameterizedType(ast);
case PARENTHESIZED_EXPRESSION:
return new ParenthesizedExpression(ast);
case POSTFIX_EXPRESSION:
return new PostfixExpression(ast);
case PREFIX_EXPRESSION:
return new PrefixExpression(ast);
case PRIMITIVE_TYPE:
return new PrimitiveType(ast);
case QUALIFIED_NAME:
return new QualifiedName(ast);
case QUALIFIED_TYPE:
return new QualifiedType(ast);
case RETURN_STATEMENT:
return new ReturnStatement(ast);
case SIMPLE_NAME:
return new SimpleName(ast);
case SIMPLE_TYPE:
return new SimpleType(ast);
case SINGLE_MEMBER_ANNOTATION:
return new SingleMemberAnnotation(ast);
case SINGLE_VARIABLE_DECLARATION:
return new SingleVariableDeclaration(ast);
case STRING_LITERAL:
return new StringLiteral(ast);
case SUPER_CONSTRUCTOR_INVOCATION:
return new SuperConstructorInvocation(ast);
case SUPER_FIELD_ACCESS:
return new SuperFieldAccess(ast);
case SUPER_METHOD_INVOCATION:
return new SuperMethodInvocation(ast);
case SWITCH_CASE:
return new SwitchCase(ast);
case SWITCH_STATEMENT:
return new SwitchStatement(ast);
case SYNCHRONIZED_STATEMENT:
return new SynchronizedStatement(ast);
case TAG_ELEMENT:
return new TagElement(ast);
case TEXT_ELEMENT:
return new TextElement(ast);
case THIS_EXPRESSION:
return new ThisExpression(ast);
case THROW_STATEMENT:
return new ThrowStatement(ast);
case TRY_STATEMENT:
return new TryStatement(ast);
case TYPE_DECLARATION:
return new TypeDeclaration(ast);
case TYPE_DECLARATION_STATEMENT:
return new TypeDeclarationStatement(ast);
case TYPE_LITERAL:
return new TypeLiteral(ast);
case TYPE_PARAMETER:
return new TypeParameter(ast);
case VARIABLE_DECLARATION_EXPRESSION:
return new VariableDeclarationExpression(ast);
case VARIABLE_DECLARATION_FRAGMENT:
return new VariableDeclarationFragment(ast);
case VARIABLE_DECLARATION_STATEMENT:
return new VariableDeclarationStatement(ast);
case WHILE_STATEMENT:
return new WhileStatement(ast);
case WILDCARD_TYPE:
return new WildcardType(ast);
}
throw new IllegalArgumentException();
}

public static ASTNode nodeClassForType ( int nodeType , AST ast ) { switch ( nodeType ) { case ANNOTATION_TYPE_DECLARATION : return new AnnotationTypeDeclaration ( ast ) ; case ANNOTATION_TYPE_MEMBER_DECLARATION : return new AnnotationTypeMemberDeclaration ( ast ) ; case ANONYMOUS_CLASS_DECLARATION : return new AnonymousClassDeclaration ( ast ) ; case ARRAY_ACCESS : return new ArrayAccess ( ast ) ; case ARRAY_CREATION : return new ArrayCreation ( ast ) ; case ARRAY_INITIALIZER : return new ArrayInitializer ( ast ) ; case ARRAY_TYPE : return new ArrayType ( ast ) ; case ASSERT_STATEMENT : return new AssertStatement ( ast ) ; case ASSIGNMENT : return new Assignment ( ast ) ; case BLOCK : return new Block ( ast ) ; case BLOCK_COMMENT : return new BlockComment ( ast ) ; case BOOLEAN_LITERAL : return new BooleanLiteral ( ast ) ; case BREAK_STATEMENT : return new BreakStatement ( ast ) ; case CAST_EXPRESSION : return new CastExpression ( ast ) ; case CATCH_CLAUSE : return new CatchClause ( ast ) ; case CHARACTER_LITERAL : return new CharacterLiteral ( ast ) ; case CLASS_INSTANCE_CREATION : return new ClassInstanceCreation ( ast ) ; case COMPILATION_UNIT : return new CompilationUnit ( ast ) ; case CONDITIONAL_EXPRESSION : return new ConditionalExpression ( ast ) ; case CONSTRUCTOR_INVOCATION : return new ConstructorInvocation ( ast ) ; case CONTINUE_STATEMENT : return new ContinueStatement ( ast ) ; case UNION_TYPE : return new UnionType ( ast ) ; case DO_STATEMENT : return new DoStatement ( ast ) ; case EMPTY_STATEMENT : return new EmptyStatement ( ast ) ; case ENHANCED_FOR_STATEMENT : return new EnhancedForStatement ( ast ) ; case ENUM_CONSTANT_DECLARATION : return new EnumConstantDeclaration ( ast ) ; case ENUM_DECLARATION : return new EnumDeclaration ( ast ) ; case EXPRESSION_STATEMENT : return new ExpressionStatement ( ast ) ; case FIELD_ACCESS : return new FieldAccess ( ast ) ; case FIELD_DECLARATION : return new FieldDeclaration ( ast ) ; case FOR_STATEMENT : return new ForStatement ( ast ) ; case IF_STATEMENT : return new IfStatement ( ast ) ; case IMPORT_DECLARATION : return new ImportDeclaration ( ast ) ; case INFIX_EXPRESSION : return new InfixExpression ( ast ) ; case INITIALIZER : return new Initializer ( ast ) ; case INSTANCEOF_EXPRESSION : return new InstanceofExpression ( ast ) ; case JAVADOC : return new Javadoc ( ast ) ; case LABELED_STATEMENT : return new LabeledStatement ( ast ) ; case LINE_COMMENT : return new LineComment ( ast ) ; case MARKER_ANNOTATION : return new MarkerAnnotation ( ast ) ; case MEMBER_REF : return new MemberRef ( ast ) ; case MEMBER_VALUE_PAIR : return new MemberValuePair ( ast ) ; case METHOD_DECLARATION : return new MethodDeclaration ( ast ) ; case METHOD_INVOCATION : return new MethodInvocation ( ast ) ; case METHOD_REF : return new MethodRef ( ast ) ; case METHOD_REF_PARAMETER : return new MethodRefParameter ( ast ) ; case MODIFIER : return new Modifier ( ast ) ; case NORMAL_ANNOTATION : return new NormalAnnotation ( ast ) ; case NULL_LITERAL : return new NullLiteral ( ast ) ; case NUMBER_LITERAL : return new NumberLiteral ( ast ) ; case PACKAGE_DECLARATION : return new PackageDeclaration ( ast ) ; case PARAMETERIZED_TYPE : return new ParameterizedType ( ast ) ; case PARENTHESIZED_EXPRESSION : return new ParenthesizedExpression ( ast ) ; case POSTFIX_EXPRESSION : return new PostfixExpression ( ast ) ; case PREFIX_EXPRESSION : return new PrefixExpression ( ast ) ; case PRIMITIVE_TYPE : return new PrimitiveType ( ast ) ; case QUALIFIED_NAME : return new QualifiedName ( ast ) ; case QUALIFIED_TYPE : return new QualifiedType ( ast ) ; case RETURN_STATEMENT : return new ReturnStatement ( ast ) ; case SIMPLE_NAME : return new SimpleName ( ast ) ; case SIMPLE_TYPE : return new SimpleType ( ast ) ; case SINGLE_MEMBER_ANNOTATION : return new SingleMemberAnnotation ( ast ) ; case SINGLE_VARIABLE_DECLARATION : return new SingleVariableDeclaration ( ast ) ; case STRING_LITERAL : return new StringLiteral ( ast ) ; case SUPER_CONSTRUCTOR_INVOCATION : return new SuperConstructorInvocation ( ast ) ; case SUPER_FIELD_ACCESS : return new SuperFieldAccess ( ast ) ; case SUPER_METHOD_INVOCATION : return new SuperMethodInvocation ( ast ) ; case SWITCH_CASE : return new SwitchCase ( ast ) ; case SWITCH_STATEMENT : return new SwitchStatement ( ast ) ; case SYNCHRONIZED_STATEMENT : return new SynchronizedStatement ( ast ) ; case TAG_ELEMENT : return new TagElement ( ast ) ; case TEXT_ELEMENT : return new TextElement ( ast ) ; case THIS_EXPRESSION : return new ThisExpression ( ast ) ; case THROW_STATEMENT : return new ThrowStatement ( ast ) ; case TRY_STATEMENT : return new TryStatement ( ast ) ; case TYPE_DECLARATION : return new TypeDeclaration ( ast ) ; case TYPE_DECLARATION_STATEMENT : return new TypeDeclarationStatement ( ast ) ; case TYPE_LITERAL : return new TypeLiteral ( ast ) ; case TYPE_PARAMETER : return new TypeParameter ( ast ) ; case VARIABLE_DECLARATION_EXPRESSION : return new VariableDeclarationExpression ( ast ) ; case VARIABLE_DECLARATION_FRAGMENT : return new VariableDeclarationFragment ( ast ) ; case VARIABLE_DECLARATION_STATEMENT : return new VariableDeclarationStatement ( ast ) ; case WHILE_STATEMENT : return new WhileStatement ( ast ) ; case WILDCARD_TYPE : return new WildcardType ( ast ) ; } throw new IllegalArgumentException ( ) ; }
returns the node class for the corresponding node type .
