Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


javax.ide.model.java.source
Class TreeFactory

java.lang.Object
  extended by javax.ide.model.java.source.TreeFactory


public abstract class TreeFactory
extends java.lang.Object

Creates all Tree objects except for FileT objects. A TreeFactory is owned by a specific FileT and all the Tree objects created by the factory are owned by the same FileT.


Constructor Summary
TreeFactory()
           

 

Method Summary
 AnnotationT createAnnotation(java.lang.String name)
          Creates an annotation (but not an annotation type).
abstract  AnnotationT createAnnotation(java.lang.String name, ListExpressionT arguments)
          Creates an annotation (but not an annotation type).
 ListExpressionT createArgumentList()
          Creates an argument list.
 ListExpressionT createArgumentList(ExpressionT argument)
          Creates an argument list.
 ListExpressionT createArgumentList(ExpressionT[] arguments)
          Creates an argument list.
abstract  ArrayAccessExpressionT createArrayAccess(ExpressionT lhs, ListExpressionT dereferences)
          Creates an array access.
 ListExpressionT createArrayConstant()
          Creates an array constant.
 ListExpressionT createArrayConstant(ExpressionT operand)
          Creates an array constant.
abstract  ListExpressionT createArrayConstant(ExpressionT[] operands)
          Creates an array constant.
abstract  AssertStatementT createAssertStatement(ExpressionT condition, ExpressionT output)
          Creates an assert statement.
abstract  AssignmentExpressionT createAssignment(ExpressionT.ExpressionKind kind, ExpressionT lhs, ExpressionT rhs)
          Creates an assignment expression.
 BlockT createBlock()
          Creates an empty code block.
 BlockT createBlock(BlockElementT element)
          Creates an empty code block.
abstract  BlockT createBlock(BlockElementT[] elements)
          Creates a code block.
abstract  BlockStatementT createBlockStatement(BlockT block)
          Creates a block statement.
abstract  BreakStatementT createBreakStatement(java.lang.String target)
          Creates a break statement.
abstract  CatchClauseT createCatchClause(FormalParameterListT parameters, BlockStatementT child)
          Creates a catch clause for a try-catch or a try-catch-finally statement.
 CatchClauseT createCatchClause(FormalParameterT parameter, BlockStatementT child)
          Creates a catch clause for a try-catch or a try-catch-finally statement.
 ClassT createClass(ClassT.ClassKind typeKind, java.lang.String name, SuperclassT superclass, InterfacesT interfaces, ClassBodyT body)
          Creates a class declaration.
abstract  ClassT createClass(ClassT.ClassKind typeKind, java.lang.String name, TypeParameterT[] typeParameters, SuperclassT superclass, InterfacesT interfaces, ClassBodyT body)
          Creates a class declaration.
 ClassBodyT createClassBody()
          Creates a class body.
 ClassBodyT createClassBody(MemberT member)
          Creates a class body.
abstract  ClassBodyT createClassBody(MemberT[] members)
          Creates a class body.
abstract  ClassInitializerT createClassInitializer(int modifiers, BlockT block)
          Creates a class initializer.
 MethodT createConstructor(FormalParameterListT parameters, ThrowsT throwsClause, BlockT block)
          Creates a constructor declaration
abstract  MethodT createConstructor(TypeParameterT[] typeParameters, FormalParameterListT parameters, ThrowsT throwsClause, BlockT block)
          Creates a constructor declaration
abstract  ContinueStatementT createContinueStatement(java.lang.String target)
          Creates a continue statement.
 DocCommentT createDocComment(java.lang.String rawText)
          Creates a doc comment with the given raw text, with '\n' line terminators.
abstract  DoStatementT createDoStatement(ExpressionT e, StatementT child)
          Creates a do-while statement.
abstract  DotExpressionT createDotReference(ExpressionT lhs, java.lang.String name)
          Creates a dot reference.
abstract  ElseClauseT createElseClause(StatementT child)
          Creates an else clause for an if statement.
abstract  EmptyStatementT createEmptyStatement()
          Creates an empty statement.
abstract  FieldDeclT createEnumConstant(java.lang.String name, ListExpressionT arguments, ClassBodyT body)
           
 ListExpressionT createExpressionList()
          Creates a list expression.
 ListExpressionT createExpressionList(ExpressionT argument)
          Creates a list expression.
abstract  ListExpressionT createExpressionList(ExpressionT[] arguments)
          Creates a list expression.
abstract  ExpressionStatementT createExpressionStatement(ExpressionT e)
          Creates an expression statement.
 FieldDeclT createFieldDeclaration(FieldVariableT variable)
          Creates a field declaration.
abstract  FieldDeclT createFieldDeclaration(FieldVariableT one, FieldVariableT[] more)
          Creates a field declaration.
abstract  FieldDeclT createFieldDeclaration(LocalVariableDeclT variables)
          Creates a field declaration to match the local variable declaration.
 FieldDeclT createFieldDeclaration(LocalVariableT variable)
          Creates a field variable to match the local variable.
abstract  FieldVariableT createFieldVariable(LocalVariableT variable)
          Creates a field variable to match the local variable.
abstract  FinallyClauseT createFinallyClause(BlockStatementT child)
          Creates a finally clause for a try statement.
abstract  ForStatementT createForEnhancedStatement(LocalVariableT loopVariable, ExpressionT collection, StatementT child)
          Creates an enhanced-for loop.
abstract  FormalParameterT createFormalParameter(LocalVariableT variable)
          Creates a formal parameter.
 FormalParameterListT createFormalParameterList()
          Creates a formal parameter list.
 FormalParameterListT createFormalParameterList(FormalParameterT parameter)
          Creates a formal parameter list.
abstract  FormalParameterListT createFormalParameterList(FormalParameterT[] parameters)
          Creates a formal parameter list.
 ForStatementT createForStatement(ExpressionT initialization, ExpressionT condition, ExpressionT update, StatementT child)
          Convenience method.
abstract  ForStatementT createForStatement(ListExpressionT initializations, ExpressionT condition, ListExpressionT updates, StatementT child)
          Creates a traditional for loop with no variable declarators.
abstract  ForStatementT createForVariableStatement(LocalVariableDeclT variables, ExpressionT condition, ListExpressionT updates, StatementT child)
          Creates a traditional for loop with variable declarators.
 ForStatementT createForVariableStatement(LocalVariableT variable, ExpressionT condition, ExpressionT update, StatementT child)
          Convenience method.
abstract  IdentifierExpressionT createIdentifierExpression(java.lang.String name)
          Creates a simple name expression.
 IfStatementT createIfElseStatement(ExpressionT e, StatementT trueClause, StatementT elseClause)
          Creates an if-else statement.
abstract  IfStatementT createIfStatement(ExpressionT e, StatementT child)
          Creates an if statement.
abstract  IfStatementT createIfStatement(ExpressionT e, StatementT child, ElseClauseT elseClause)
          Creates an if or an if-else statement.
abstract  ImportT createImportDeclaration(java.lang.String name)
          Creates an import declaration.
 InfixExpressionT createInfixExpression(ExpressionT.ExpressionKind kind, ExpressionT lhs, ExpressionT rhs)
          Creates an infix expression with two operands.
abstract  InfixExpressionT createInfixExpression(ExpressionT.ExpressionKind kind, ExpressionT one, ExpressionT two, ExpressionT[] operands)
          Creates an infix expression with multiple operands.
 ClassInitializerT createInstanceInitializer(BlockT block)
          Creates an instance class initializer.
abstract  InfixExpressionT createInstanceof(ExpressionT lhs, TypeReferenceT type)
          Creates a new instanceof expression.
 InterfacesT createInterfacesClause(TypeReferenceT oneInterface)
          Creates an interfaces clauses for a class declaration.
abstract  InterfacesT createInterfacesClause(TypeReferenceT one, TypeReferenceT[] more)
          Creates an interfaces clauses for a class declaration.
abstract  LocalVariableT createLocalVariable(TypeReferenceT type, java.lang.String name, ExpressionT initializer)
          Creates a local variable
 LocalVariableDeclT createLocalVariableDeclaration(LocalVariableT variable)
          Creates a local variable declaration.
abstract  LocalVariableDeclT createLocalVariableDeclaration(LocalVariableT one, LocalVariableT[] more)
          Creates a local variable declaration.
abstract  MethodT createMethod(TypeParameterT[] typeParameters, TypeReferenceT returnType, java.lang.String name, FormalParameterListT parameters, ThrowsT throwsClause, BlockT block)
          Creates a method declaration.
 MethodT createMethod(TypeReferenceT returnType, java.lang.String name, FormalParameterListT parameters, ThrowsT throwsClause, BlockT block)
          Creates a method declaration.
abstract  MethodCallExpressionT createMethodCall(ExpressionT lhs, TypeArgumentT[] typeArguments, java.lang.String name, ListExpressionT arguments)
          Creates a method call.
abstract  NameT createName(java.lang.String name)
          Creates a name.
abstract  NewClassExpressionT createNewClassExpression(ExpressionT lhs, TypeReferenceT type, ListExpressionT arguments, ClassBodyT body)
          Creates a class creator.
abstract  NewArrayExpressionT createNewInitializedArrayExpression(TypeReferenceT type, ListExpressionT arrayconst)
          Creates an array creator for an uninitialized array.
abstract  NewArrayExpressionT createNewUninitializedArrayExpression(TypeReferenceT type, ListExpressionT args)
          Creates an array creator for an initialized array.
abstract  PackageT createPackageDeclaration(java.lang.String name)
          Creates a package declaration.
abstract  QuestionExpressionT createQuestionExpression(ExpressionT one, ExpressionT two, ExpressionT three)
          Creates a question expression.
abstract  ReturnStatementT createReturnStatement(ExpressionT e)
          Creates a return statement.
abstract  ImportT createStaticImportDeclaration(java.lang.String name)
          Creates an import declaration.
 ClassInitializerT createStaticInitializer(BlockT block)
          Creates a static class initializer.
abstract  SuperclassT createSuperclassClause(TypeReferenceT superclass)
          Creates a superclass clause for a class declaration.
abstract  SwitchStatementT createSwitchStatement(ExpressionT e, BlockStatementT child)
          Creates a switch statement.
abstract  SynchStatementT createSynchronizedStatement(ExpressionT e, BlockStatementT child)
          Creates a synchronized statement.
 ThrowsT createThrowsClause(TypeReferenceT exception)
          Creates a throws clause for a method or constructor declaration.
abstract  ThrowsT createThrowsClause(TypeReferenceT[] exceptions)
          Creates a throws clause for a method or constructor declaration.
abstract  ThrowStatementT createThrowStatement(ExpressionT e)
          Creates a throw statement.
abstract  TryStatementT createTryCatchFinallyStatement(BlockStatementT tryClause, FormalParameterT parameter, BlockStatementT catchClause, BlockStatementT finallyClause)
          Creates a try-catch-finally statement with a single catch clause.
abstract  TryStatementT createTryCatchStatement(BlockStatementT tryClause, FormalParameterT parameter, BlockStatementT catchClause)
          Creates a try-catch statement with a single catch clause.
abstract  TryStatementT createTryFinallyStatement(BlockStatementT child, BlockStatementT finallyClause)
          Creates a try-finally statement.
abstract  TryStatementT createTryStatement(BlockStatementT tryClause, CatchClauseT[] catchClauses, FinallyClauseT finallyClause)
          Creates a try, try-catch, try-catch-finally, or a try-finally statement.
 TryStatementT createTryStatement(BlockStatementT tryClause, CatchClauseT catchClause, FinallyClauseT finallyClause)
          Creates a try, try-catch, try-catch-finally, or a try-finally statement.
abstract  TypeArgumentT createTypeArgument(TypeArgumentT.BoundKind bound, TypeReferenceT type)
          Creates a type argument.
abstract  TypecastExpressionT createTypecast(TypeReferenceT type, ExpressionT operand)
          Creates a typecast.
abstract  TypeExpressionT createTypeExpression(TypeReferenceT type)
          Creates a type expression.
 TypeParameterT createTypeParameter(java.lang.String name)
          Creates a type parameter.
 TypeParameterT createTypeParameter(java.lang.String name, TypeReferenceT bound)
          Creates a type parameter.
abstract  TypeParameterT createTypeParameter(java.lang.String name, TypeReferenceT[] bounds)
          Creates a type parameter.
 TypeReferenceT createTypeReference(java.lang.String name)
          Creates a type reference.
abstract  TypeReferenceT createTypeReference(java.lang.String name, int dimensions)
          Creates a type reference.
abstract  UnaryExpressionT createUnaryExpression(ExpressionT.ExpressionKind kind, ExpressionT operand)
          Creates a unary expression.
abstract  WhileStatementT createWhileStatement(ExpressionT e, StatementT child)
          Creates a while statement.
abstract  WrapperExpressionT createWrapperExpression(ExpressionT operand)
          Creates a wrapper expression.
abstract  AnnotationT textToAnnotation(java.lang.String text)
          Attempts to create a type with the given text.
abstract  BlockT textToBlock(java.lang.String text)
          Attempts to create a block with the given text.
abstract  BlockElementT textToBlockElement(java.lang.String text)
          Attempts to create a block element with the given text.
abstract  ClassT textToClass(java.lang.String text)
          Attempts to create a class with the given text.
abstract  DocCommentT textToDocComment(java.lang.String text)
          Attempts to create a doc comment with the given text.
abstract  ExpressionT textToExpression(java.lang.String text)
          Attempts to create an expression with the given text.
abstract  MemberT textToMember(java.lang.String text)
          Attempts to create a member with the given text.
abstract  StatementT textToStatement(java.lang.String text)
          Attempts to create a statement with the given text.
abstract  TypeReferenceT textToTypeReference(java.lang.String text)
          Attempts to create a type with the given text.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

TreeFactory

public TreeFactory()

Method Detail

createName

public abstract NameT createName(java.lang.String name)
Creates a name.
Parameters:
name - Require non-empty.

createTypeReference

public final TypeReferenceT createTypeReference(java.lang.String name)
Creates a type reference.
Parameters:
name - Require non-null.

createTypeReference

public abstract TypeReferenceT createTypeReference(java.lang.String name,
                                                   int dimensions)
Creates a type reference.
Parameters:
name - Require non-null. Must be a simple name.
dimensions - Require non-negative.

createTypeArgument

public abstract TypeArgumentT createTypeArgument(TypeArgumentT.BoundKind bound,
                                                 TypeReferenceT type)
Creates a type argument.
Parameters:
bound - Assuming the type is named "T", here is what you get for the indicated value of bound.
   BOUND_NARROW   T
   BOUND_EXTENDS  ? extends T
   BOUND_SUPER    ? super T
   BOUND_NONE     ?
 
type - Ignored if bound == BOUND_NONE.

textToAnnotation

public abstract AnnotationT textToAnnotation(java.lang.String text)
Attempts to create a type with the given text.

textToBlock

public abstract BlockT textToBlock(java.lang.String text)
Attempts to create a block with the given text.

textToClass

public abstract ClassT textToClass(java.lang.String text)
Attempts to create a class with the given text.

textToDocComment

public abstract DocCommentT textToDocComment(java.lang.String text)
Attempts to create a doc comment with the given text.

textToExpression

public abstract ExpressionT textToExpression(java.lang.String text)
Attempts to create an expression with the given text.

textToMember

public abstract MemberT textToMember(java.lang.String text)
Attempts to create a member with the given text. The input may be a class, field, or method declaration. The input may also be a class initializer.

textToBlockElement

public abstract BlockElementT textToBlockElement(java.lang.String text)
Attempts to create a block element with the given text.

textToStatement

public abstract StatementT textToStatement(java.lang.String text)
Attempts to create a statement with the given text.

textToTypeReference

public abstract TypeReferenceT textToTypeReference(java.lang.String text)
Attempts to create a type with the given text.

createAnnotation

public final AnnotationT createAnnotation(java.lang.String name)
Creates an annotation (but not an annotation type). The annotation type reference may not contain type arguments.
Parameters:
name - Require non-null.

createAnnotation

public abstract AnnotationT createAnnotation(java.lang.String name,
                                             ListExpressionT arguments)
Creates an annotation (but not an annotation type).
Parameters:
name - Require non-null.
arguments - Null indicates no argument list.

createTypeParameter

public final TypeParameterT createTypeParameter(java.lang.String name)
Creates a type parameter.
Parameters:
name - Require non-null.

createTypeParameter

public final TypeParameterT createTypeParameter(java.lang.String name,
                                                TypeReferenceT bound)
Creates a type parameter.
Parameters:
name - Require non-null.

createTypeParameter

public abstract TypeParameterT createTypeParameter(java.lang.String name,
                                                   TypeReferenceT[] bounds)
Creates a type parameter.
Parameters:
name - Require non-null.

createPackageDeclaration

public abstract PackageT createPackageDeclaration(java.lang.String name)
Creates a package declaration.
Parameters:
name - Require non-null.

createImportDeclaration

public abstract ImportT createImportDeclaration(java.lang.String name)
Creates an import declaration.
Parameters:
name - Require non-null.

createStaticImportDeclaration

public abstract ImportT createStaticImportDeclaration(java.lang.String name)
Creates an import declaration.
Parameters:
name - Require non-null.

createClass

public final ClassT createClass(ClassT.ClassKind typeKind,
                                java.lang.String name,
                                SuperclassT superclass,
                                InterfacesT interfaces,
                                ClassBodyT body)
Creates a class declaration. Useful for those unfamiliar with jdk 1.5.
Parameters:
name - Require non-null.
superclass - Null indicates none.
interfaces - Null indicates none.
body - Null indicates an empty body.

createClass

public abstract ClassT createClass(ClassT.ClassKind typeKind,
                                   java.lang.String name,
                                   TypeParameterT[] typeParameters,
                                   SuperclassT superclass,
                                   InterfacesT interfaces,
                                   ClassBodyT body)
Creates a class declaration.
Parameters:
name - Require non-null.
typeParameters - Require non-null. For none, use TypeParameterT.EMPTY_ARRAY.
superclass - Null indicates none.
interfaces - Null indicates none.
body - Null indicates an empty body.

createConstructor

public final MethodT createConstructor(FormalParameterListT parameters,
                                       ThrowsT throwsClause,
                                       BlockT block)
Creates a constructor declaration
Parameters:
parameters - Null indicates an empty parameter list.
throwsClause - Null indicates no throws clause.
block - Null indicates no an empty block.

createConstructor

public abstract MethodT createConstructor(TypeParameterT[] typeParameters,
                                          FormalParameterListT parameters,
                                          ThrowsT throwsClause,
                                          BlockT block)
Creates a constructor declaration
Parameters:
parameters - Null indicates an empty parameter list.
throwsClause - Null indicates no throws clause.
block - Null indicates no an empty block.

createMethod

public final MethodT createMethod(TypeReferenceT returnType,
                                  java.lang.String name,
                                  FormalParameterListT parameters,
                                  ThrowsT throwsClause,
                                  BlockT block)
Creates a method declaration. Useful for those unfamiliar with jdk 1.5.
Parameters:
returnType - Null indicates a void return type.
name - Require non-null.
parameters - Null indicates an empty parameter list.
throwsClause - Null indicates no throws clause.
block - Null indicates no block.

createMethod

public abstract MethodT createMethod(TypeParameterT[] typeParameters,
                                     TypeReferenceT returnType,
                                     java.lang.String name,
                                     FormalParameterListT parameters,
                                     ThrowsT throwsClause,
                                     BlockT block)
Creates a method declaration.
Parameters:
typeParameters - Require non-null. For none, use TypeParameterT.EMPTY_ARRAY.
returnType - Null indicates a void return type.
name - Require non-null.
parameters - Null indicates an empty parameter list.
throwsClause - Null indicates no throws clause.
block - Null indicates no block.

createEnumConstant

public abstract FieldDeclT createEnumConstant(java.lang.String name,
                                              ListExpressionT arguments,
                                              ClassBodyT body)
Parameters:
name - Require non-null.
arguments - Null indicates none.
body - Null indicates none.

createInstanceInitializer

public final ClassInitializerT createInstanceInitializer(BlockT block)
Creates an instance class initializer.
Parameters:
block - Null indicates an empty block.

createStaticInitializer

public final ClassInitializerT createStaticInitializer(BlockT block)
Creates a static class initializer.
Parameters:
block - Null indicates an empty block.

createClassInitializer

public abstract ClassInitializerT createClassInitializer(int modifiers,
                                                         BlockT block)
Creates a class initializer.
Parameters:
modifiers - A bit mask with values from java.lang.reflect.Modifier.
block - Null indicates an empty block.

createFieldVariable

public abstract FieldVariableT createFieldVariable(LocalVariableT variable)
Creates a field variable to match the local variable. Note, this function does not convert the local variable. Instead, this function creates a field that uses the variable's type and name. The input local variable should be discarded after this.
Parameters:
variable - Require non-null.

createFieldDeclaration

public final FieldDeclT createFieldDeclaration(LocalVariableT variable)
Creates a field variable to match the local variable. Note, this function does not convert the local variable. Instead, this function creates a field that uses the variable's type and name. The input local variable should be discarded after this.
Parameters:
variable - Require non-null.

createFieldDeclaration

public final FieldDeclT createFieldDeclaration(FieldVariableT variable)
Creates a field declaration.

createFieldDeclaration

public abstract FieldDeclT createFieldDeclaration(FieldVariableT one,
                                                  FieldVariableT[] more)
Creates a field declaration.

createFieldDeclaration

public abstract FieldDeclT createFieldDeclaration(LocalVariableDeclT variables)
Creates a field declaration to match the local variable declaration. Note, this function does not convert the local variable declaration or any fo the variables therein. Instead, this function creates a field variable for each local variable and then creates a field declaration out of those field variables. The input local variable declaration should be discarded after this.
Parameters:
variables - Require non-null.

createSuperclassClause

public abstract SuperclassT createSuperclassClause(TypeReferenceT superclass)
Creates a superclass clause for a class declaration.

createInterfacesClause

public final InterfacesT createInterfacesClause(TypeReferenceT oneInterface)
Creates an interfaces clauses for a class declaration.

createInterfacesClause

public abstract InterfacesT createInterfacesClause(TypeReferenceT one,
                                                   TypeReferenceT[] more)
Creates an interfaces clauses for a class declaration.

createClassBody

public final ClassBodyT createClassBody()
Creates a class body.

createClassBody

public final ClassBodyT createClassBody(MemberT member)
Creates a class body.

createClassBody

public abstract ClassBodyT createClassBody(MemberT[] members)
Creates a class body.

createFormalParameterList

public final FormalParameterListT createFormalParameterList()
Creates a formal parameter list.

createFormalParameterList

public final FormalParameterListT createFormalParameterList(FormalParameterT parameter)
Creates a formal parameter list.

createFormalParameterList

public abstract FormalParameterListT createFormalParameterList(FormalParameterT[] parameters)
Creates a formal parameter list.

createFormalParameter

public abstract FormalParameterT createFormalParameter(LocalVariableT variable)
Creates a formal parameter.

createThrowsClause

public final ThrowsT createThrowsClause(TypeReferenceT exception)
Creates a throws clause for a method or constructor declaration.
Returns:
Null if empty.

createThrowsClause

public abstract ThrowsT createThrowsClause(TypeReferenceT[] exceptions)
Creates a throws clause for a method or constructor declaration.
Parameters:
exceptions - Require non-null. For an empty exception array use TypeReferenceT.EMPTY_ARRAY.
Returns:
Null if empty.

createLocalVariable

public abstract LocalVariableT createLocalVariable(TypeReferenceT type,
                                                   java.lang.String name,
                                                   ExpressionT initializer)
Creates a local variable
Parameters:
type - Require non-null.
name - Require non-null.
initializer - Null indicates none.

createLocalVariableDeclaration

public final LocalVariableDeclT createLocalVariableDeclaration(LocalVariableT variable)
Creates a local variable declaration.

createLocalVariableDeclaration

public abstract LocalVariableDeclT createLocalVariableDeclaration(LocalVariableT one,
                                                                  LocalVariableT[] more)
Creates a local variable declaration.

createBlock

public final BlockT createBlock()
Creates an empty code block.

createBlock

public final BlockT createBlock(BlockElementT element)
Creates an empty code block.

createBlock

public abstract BlockT createBlock(BlockElementT[] elements)
Creates a code block.
Parameters:
elements - The elements for the code block.

createAssertStatement

public abstract AssertStatementT createAssertStatement(ExpressionT condition,
                                                       ExpressionT output)
Creates an assert statement.
Parameters:
condition - Require non-null.
output - Require non-null.

createBlockStatement

public abstract BlockStatementT createBlockStatement(BlockT block)
Creates a block statement.
Parameters:
block - Null indicates an empty block.

createBreakStatement

public abstract BreakStatementT createBreakStatement(java.lang.String target)
Creates a break statement.
Parameters:
target - Null indicates the implicitly enclosing loop.

createCatchClause

public final CatchClauseT createCatchClause(FormalParameterT parameter,
                                            BlockStatementT child)
Creates a catch clause for a try-catch or a try-catch-finally statement. The input parameter will be converted to be a formal parameter, namely SRC_FORMAL_PARAMETER.
Parameters:
parameter - Require non-null.
child - Null indicates an empty clause.

createCatchClause

public abstract CatchClauseT createCatchClause(FormalParameterListT parameters,
                                               BlockStatementT child)
Creates a catch clause for a try-catch or a try-catch-finally statement.
Parameters:
parameters - Require non-null. Must have exactly one parameter.
child - Null indicates an empty clause.

createContinueStatement

public abstract ContinueStatementT createContinueStatement(java.lang.String target)
Creates a continue statement.
Parameters:
target - Null indicates the implicitly enclosing loop.

createDoStatement

public abstract DoStatementT createDoStatement(ExpressionT e,
                                               StatementT child)
Creates a do-while statement.
Parameters:
e - Require non-null
child - Null indicates an empty clause.

createElseClause

public abstract ElseClauseT createElseClause(StatementT child)
Creates an else clause for an if statement.
Parameters:
child - Null indicates an empty clause.

createEmptyStatement

public abstract EmptyStatementT createEmptyStatement()
Creates an empty statement.

createExpressionStatement

public abstract ExpressionStatementT createExpressionStatement(ExpressionT e)
Creates an expression statement.
Parameters:
e - Require non-null.

createFinallyClause

public abstract FinallyClauseT createFinallyClause(BlockStatementT child)
Creates a finally clause for a try statement.
Parameters:
child - Null indicates an empty clause.

createForStatement

public final ForStatementT createForStatement(ExpressionT initialization,
                                              ExpressionT condition,
                                              ExpressionT update,
                                              StatementT child)
Convenience method. Creates a traditional for loop with no variable declarators and with at most one initialization and at most one update.
Parameters:
initialization - Null means no initializations.
condition - Null means an implicitly true condition.
update - Null means no updates.
child - Null indicates an empty clause.

createForStatement

public abstract ForStatementT createForStatement(ListExpressionT initializations,
                                                 ExpressionT condition,
                                                 ListExpressionT updates,
                                                 StatementT child)
Creates a traditional for loop with no variable declarators.
Parameters:
initializations - Null means no initializations.
condition - Null means an implicitly true condition.
updates - Null means no updates.
child - Null indicates an empty clause.

createForVariableStatement

public final ForStatementT createForVariableStatement(LocalVariableT variable,
                                                      ExpressionT condition,
                                                      ExpressionT update,
                                                      StatementT child)
Convenience method. Creates a traditional for loop with a single local variable and at most one update expression.
Parameters:
variable - Require non-null.
condition - Null means an implicitly true condition.
update - Null means no update.
child - Null indicates an empty clause.

createForVariableStatement

public abstract ForStatementT createForVariableStatement(LocalVariableDeclT variables,
                                                         ExpressionT condition,
                                                         ListExpressionT updates,
                                                         StatementT child)
Creates a traditional for loop with variable declarators.
Parameters:
variables - Require non-null. Require at least one variable.
condition - Null means an implicitly true condition.
updates - Null means no updates.
child - Null indicates an empty clause.

createForEnhancedStatement

public abstract ForStatementT createForEnhancedStatement(LocalVariableT loopVariable,
                                                         ExpressionT collection,
                                                         StatementT child)
Creates an enhanced-for loop.
Parameters:
loopVariable - Require non-null.
collection - Require non-null.
child - Null indicates an empty clause.

createIfStatement

public abstract IfStatementT createIfStatement(ExpressionT e,
                                               StatementT child)
Creates an if statement. Will not create the else clause.
Parameters:
e - Require non-null.
child - Null indicates an empty clause.

createIfStatement

public abstract IfStatementT createIfStatement(ExpressionT e,
                                               StatementT child,
                                               ElseClauseT elseClause)
Creates an if or an if-else statement. Will not create the else clause if none is given.
Parameters:
e - Require non-null
child - Null indicates an empty true clause.
elseClause - Null means no else clause.

createIfElseStatement

public final IfStatementT createIfElseStatement(ExpressionT e,
                                                StatementT trueClause,
                                                StatementT elseClause)
Creates an if-else statement. Always creates the else clause, even if empty.
Parameters:
e - Require non-null.
trueClause - Null indicates an empty true clause.
elseClause - Null indicates an empty else clause.

createReturnStatement

public abstract ReturnStatementT createReturnStatement(ExpressionT e)
Creates a return statement.
Parameters:
e - Null indicates a void return.

createSwitchStatement

public abstract SwitchStatementT createSwitchStatement(ExpressionT e,
                                                       BlockStatementT child)
Creates a switch statement.
Parameters:
e - Require non-null.
child - Null indicates an empty block.

createSynchronizedStatement

public abstract SynchStatementT createSynchronizedStatement(ExpressionT e,
                                                            BlockStatementT child)
Creates a synchronized statement.
Parameters:
e - Require non-null.
child - Null indicates an empty block.

createThrowStatement

public abstract ThrowStatementT createThrowStatement(ExpressionT e)
Creates a throw statement.
Parameters:
e - Require non-null.

createTryStatement

public final TryStatementT createTryStatement(BlockStatementT tryClause,
                                              CatchClauseT catchClause,
                                              FinallyClauseT finallyClause)
Creates a try, try-catch, try-catch-finally, or a try-finally statement.
Parameters:
tryClause - Null indicates an empty try clause.
catchClause - Require non-null. If you want no catch clauses, use CatchClauseT.EMPTY_ARRAY.
finallyClause - Null indicates no finally clause.

createTryStatement

public abstract TryStatementT createTryStatement(BlockStatementT tryClause,
                                                 CatchClauseT[] catchClauses,
                                                 FinallyClauseT finallyClause)
Creates a try, try-catch, try-catch-finally, or a try-finally statement.
Parameters:
tryClause - Null indicates an empty try clause.
catchClauses - Require non-null. If you want no catch clauses, use CatchClauseT.EMPTY_ARRAY.
finallyClause - Null indicates no finally clause.

createTryCatchStatement

public abstract TryStatementT createTryCatchStatement(BlockStatementT tryClause,
                                                      FormalParameterT parameter,
                                                      BlockStatementT catchClause)
Creates a try-catch statement with a single catch clause.
Parameters:
tryClause - Null indicates an empty try clause.
parameter - Require non-null.
catchClause - Null indicates an empty catch clause.

createTryCatchFinallyStatement

public abstract TryStatementT createTryCatchFinallyStatement(BlockStatementT tryClause,
                                                             FormalParameterT parameter,
                                                             BlockStatementT catchClause,
                                                             BlockStatementT finallyClause)
Creates a try-catch-finally statement with a single catch clause. Always creates the finally clause.
Parameters:
tryClause - Null indicates an empty try clause.
parameter - Require non-null.
catchClause - Null indicates an empty catch clause.
finallyClause - Null indicates an empty finally clause.

createTryFinallyStatement

public abstract TryStatementT createTryFinallyStatement(BlockStatementT child,
                                                        BlockStatementT finallyClause)
Creates a try-finally statement. Always creates the finally clause.
Parameters:
child - Null indicates an empty try clause.
finallyClause - Null indicates an empty finally clause.

createWhileStatement

public abstract WhileStatementT createWhileStatement(ExpressionT e,
                                                     StatementT child)
Creates a while statement.
Parameters:
e - Require non-null.
child - Null indicates an empty clause.

createArgumentList

public final ListExpressionT createArgumentList()
Creates an argument list.

createArgumentList

public final ListExpressionT createArgumentList(ExpressionT argument)
Creates an argument list.
Parameters:
argument - Null indicates an empty list.

createArgumentList

public final ListExpressionT createArgumentList(ExpressionT[] arguments)
Creates an argument list.
Parameters:
arguments - Null indicates an empty list.

createArrayAccess

public abstract ArrayAccessExpressionT createArrayAccess(ExpressionT lhs,
                                                         ListExpressionT dereferences)
Creates an array access.
Parameters:
lhs - Require non-null.
dereferences - Requires non-null. Use createArgumentList([).

createArrayConstant

public final ListExpressionT createArrayConstant()
Creates an array constant.

createArrayConstant

public final ListExpressionT createArrayConstant(ExpressionT operand)
Creates an array constant.

createArrayConstant

public abstract ListExpressionT createArrayConstant(ExpressionT[] operands)
Creates an array constant.

createNewInitializedArrayExpression

public abstract NewArrayExpressionT createNewInitializedArrayExpression(TypeReferenceT type,
                                                                        ListExpressionT arrayconst)
Creates an array creator for an uninitialized array.
Parameters:
type - Require non-null.

createNewUninitializedArrayExpression

public abstract NewArrayExpressionT createNewUninitializedArrayExpression(TypeReferenceT type,
                                                                          ListExpressionT args)
Creates an array creator for an initialized array.

createAssignment

public abstract AssignmentExpressionT createAssignment(ExpressionT.ExpressionKind kind,
                                                       ExpressionT lhs,
                                                       ExpressionT rhs)
Creates an assignment expression.

createNewClassExpression

public abstract NewClassExpressionT createNewClassExpression(ExpressionT lhs,
                                                             TypeReferenceT type,
                                                             ListExpressionT arguments,
                                                             ClassBodyT body)
Creates a class creator. Class creators have the form:
   new type( arg )
   new type( arg ) { void bodyMethods(); }
   lhs.new type( arg )
   lhs.new type( arg ) { void bodyMethods(); }
 
Parameters:
lhs - Non-null indicates a qualified class creator (for creating non-static inner classes).
type - Require non-null. Require non-array reference type.
arguments - Null indicates no arguments. Use createArgumentList([).
body - Non-null indicates an anonymous class.

createDotReference

public abstract DotExpressionT createDotReference(ExpressionT lhs,
                                                  java.lang.String name)
Creates a dot reference. Dot references have the form: lhs.name
Parameters:
lhs - Require non-null.
name - Require non-null.

createExpressionList

public final ListExpressionT createExpressionList()
Creates a list expression. May not be used in place of an array constant.

createExpressionList

public final ListExpressionT createExpressionList(ExpressionT argument)
Creates a list expression. May not be used in place of an array constant.

createExpressionList

public abstract ListExpressionT createExpressionList(ExpressionT[] arguments)
Creates a list expression. May not be used in place of an array constant.

createInfixExpression

public final InfixExpressionT createInfixExpression(ExpressionT.ExpressionKind kind,
                                                    ExpressionT lhs,
                                                    ExpressionT rhs)
Creates an infix expression with two operands.

createInfixExpression

public abstract InfixExpressionT createInfixExpression(ExpressionT.ExpressionKind kind,
                                                       ExpressionT one,
                                                       ExpressionT two,
                                                       ExpressionT[] operands)
Creates an infix expression with multiple operands. An example is:
   "Hello" + ' ' + "world!"
 
Parameters:
operands - Must have at least two operands.

createInstanceof

public abstract InfixExpressionT createInstanceof(ExpressionT lhs,
                                                  TypeReferenceT type)
Creates a new instanceof expression.
Parameters:
lhs - Require non-null.
type - Require a reference type.

createMethodCall

public abstract MethodCallExpressionT createMethodCall(ExpressionT lhs,
                                                       TypeArgumentT[] typeArguments,
                                                       java.lang.String name,
                                                       ListExpressionT arguments)
Creates a method call.
Parameters:
lhs - Null indicates the implicit "this" lhs.
name - Require non-null.
arguments - Null indicates no arguments. Use createArgumentList([).

createQuestionExpression

public abstract QuestionExpressionT createQuestionExpression(ExpressionT one,
                                                             ExpressionT two,
                                                             ExpressionT three)
Creates a question expression.
Parameters:
one - The conditional operand. Require non-null.
two - The operand executed by the true branch. Require non-null.
three - The operand executed by the false branch. Require non-null.

createIdentifierExpression

public abstract IdentifierExpressionT createIdentifierExpression(java.lang.String name)
Creates a simple name expression.
Parameters:
name - Require non-null.

createTypeExpression

public abstract TypeExpressionT createTypeExpression(TypeReferenceT type)
Creates a type expression.
Parameters:
type - Require non-null.

createTypecast

public abstract TypecastExpressionT createTypecast(TypeReferenceT type,
                                                   ExpressionT operand)
Creates a typecast.
Parameters:
type - Require non-null. Require a reference type.
operand - Require non-null.

createUnaryExpression

public abstract UnaryExpressionT createUnaryExpression(ExpressionT.ExpressionKind kind,
                                                       ExpressionT operand)
Creates a unary expression.
Parameters:
operand - Require non-null.

createWrapperExpression

public abstract WrapperExpressionT createWrapperExpression(ExpressionT operand)
Creates a wrapper expression.
Parameters:
operand - Require non-null.

createDocComment

public final DocCommentT createDocComment(java.lang.String rawText)
Creates a doc comment with the given raw text, with '\n' line terminators.
Parameters:
rawText - Must be non-null.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.