|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Represents an abstract syntax tree (AST) node which is the basic building block of the AST model. The AST objects are basically declarations, statements and expressions organized in a hierarchical tree structure.
| Field Summary | |
static int |
ARRAY_CREATION
Constant representing a new array creation expression. |
static int |
ARRAY_INITIALIZER
Constant representing an array initializer. |
static int |
ARRAY_REFERENCE
Constant representing an array access expression. |
static int |
ASSERT_STATEMENT
Constant representing an assertion statement. |
static int |
ASSIGNMENT_EXPRESSION
Constant representing an assignment expression. |
static int |
BINARY_EXPRESSION
Constant representing a binary expression. |
static int |
BREAK_STATEMENT
Constant representing a break statement. |
static int |
CASE_LABEL
Constant representing a case label. |
static int |
CAST_EXPRESSION
Constant representing a type cast expression. |
static int |
CATCH_CLAUSE
Constant representing a catch clause of a try statement. |
static int |
CLASS_FILE
Constant representing a class file. |
static int |
COMMENT
Constant representing a comment. |
static int |
COMPILATION_UNIT
Constant representing a compilation unit. |
static int |
COMPOUND_STATEMENT
Constant representing a compound statement. |
static int |
CONDITIONAL_EXPRESSION
Constant representing a conditional expression. |
static int |
CONSTRUCTOR_INVOCATION
Constant representing an explicit constructor invocation. |
static int |
CONTINUE_STATEMENT
Constant representing a continue statement. |
static int |
DBC_RESULT
Constant representing a reference to a returned value. |
static int |
DECLARATION_STATEMENT
Constant representing a declaration statement. |
static int |
DO_STATEMENT
Constant representing a do statement. |
static int |
EMPTY_STATEMENT
Constant representing an empty statement. |
static int |
EXPRESSION_STATEMENT
Constant representing an expression statement. |
static int |
FIELD_REFERENCE
Constant representing a field access expression. |
static int |
FINALLY_CLAUSE
Constant representing a finally clause of a try statement. |
static int |
FOR_STATEMENT
Constant representing a for statement. |
static int |
IF_STATEMENT
Constant representing an if statement. |
static int |
IMPORT
Constant representing an import declaration. |
static int |
INITIALIZER
Constant representing a class initializer. |
static int |
JAVADOC_TAG
Constant representing a Javadoc tag. |
static int |
LITERAL
Constant representing a literal. |
static int |
METHOD
Constant representing a method declaration. |
static int |
METHOD_CALL_EXPRESSION
Constant representing a method invocation expression. |
static int |
N_A
Constant representing an object that does not fit into this model. |
static int |
OBJECT_CREATION_EXPRESSION
Constant representing a new object instantiation expression. |
static int |
PACKAGE
Constant representing a package. |
static int |
PARENTHESIZED_EXPRESSION
Constant representing a parenthesized expression. |
static int |
RETURN_STATEMENT
Constant representing a return statement. |
static int |
SIMPLE_REFERENCE
Constant representing a single identifier expression. |
static int |
SUPER_EXPRESSION
Constant representing a superclass access expression. |
static int |
SWITCH_GROUP
Constant representing a switch group statement. |
static int |
SWITCH_STATEMENT
Constant representing a switch statement. |
static int |
SYNCHRONIZED_STATEMENT
Constant representing a synchronized statement. |
static int |
THIS_EXPRESSION
Constant representing a this class access expression. |
static int |
THROW_SPECIFIER
Constant representing an exception type specified in a method's throw clause. |
static int |
THROW_STATEMENT
Constant representing a throw statement. |
static int |
TRY_STATEMENT
Constant representing a try statement. |
static int |
TYPE
Constant representing a class or an interface. |
static int |
TYPE_EXPRESSION
Constant representing a type expression. |
static int |
UNARY_EXPRESSION
Constant representing a unary expression. |
static int |
VARIABLE
Constant representing a declaration a field, local variable, or method parameter. |
static int |
VARIABLE_DECLARATION
Constant representing a variable declaration. |
static int |
WHILE_STATEMENT
Constant representing a while statement. |
| Method Summary | |
void |
addComment(AstComment comment)
Add new comment to the statement |
AstObject[] |
getChildren()
Returns the AST objects directly enclosed by this object. |
AstComment[] |
getComments()
Returns a list of comments associated with this object. |
AstCompilationUnit |
getCompilationUnit()
Returns the compilation unit in which this object is declared, or null if this type is not declared in a compilation unit
(for example, it is contained in a binary type or a compilation unit itself). |
AstMethod |
getDeclaringMethod()
Returns the method in which this object is declared, or null if this object is not declared in a method
(for example, a field initializer). |
AstType |
getDeclaringType()
Returns the type in which this object is declared, or null if this object is not declared in a type
(for example, a top-level type). |
int |
getObjectKind()
Returns this object's kind, encoded as an integer. |
AstPackage |
getPackage()
Returns the package in which this object is declared, or null if this object is not declared in a package
(for example, a top-level package). |
AstObject |
getParent()
Returns the object directly containing this object, or null if this element has no parent. |
AstSourcePosition |
getPosition()
Returns the source range associated with this object, or null if this object has no associated
source code. |
boolean |
isDeleted()
Check if AST node is deleted by autofix/ |
void |
remove()
Remove this object from abstract syntax tree |
void |
replaceWith(AstObject obj)
Replace object |
void |
replaceWith(AstObject obj,
AstObject parent)
Replace object |
void |
setPosition(AstSourcePosition position)
Set source poistion for object |
void |
setPositionAfter(AstSourcePosition position)
Set source poistion after location of specfied object |
void |
visitExpressions(AstExpressionVisitor visitor)
Visit all the expressions contained in this AST object including this object. |
void |
visitStatements(AstStatementVisitor visitor)
Visit all the statements contained in this AST object including this object. |
| Field Detail |
public static final int ARRAY_CREATION
public static final int ARRAY_INITIALIZER
public static final int ARRAY_REFERENCE
public static final int ASSERT_STATEMENT
public static final int ASSIGNMENT_EXPRESSION
public static final int BINARY_EXPRESSION
public static final int BREAK_STATEMENT
public static final int CASE_LABEL
public static final int CAST_EXPRESSION
public static final int CATCH_CLAUSE
public static final int CLASS_FILE
public static final int COMMENT
public static final int COMPILATION_UNIT
public static final int COMPOUND_STATEMENT
public static final int CONDITIONAL_EXPRESSION
public static final int CONSTRUCTOR_INVOCATION
public static final int CONTINUE_STATEMENT
public static final int DBC_RESULT
public static final int DECLARATION_STATEMENT
public static final int DO_STATEMENT
public static final int EMPTY_STATEMENT
public static final int EXPRESSION_STATEMENT
public static final int FIELD_REFERENCE
public static final int FINALLY_CLAUSE
public static final int FOR_STATEMENT
public static final int IF_STATEMENT
public static final int IMPORT
public static final int INITIALIZER
public static final int JAVADOC_TAG
public static final int LITERAL
public static final int METHOD
public static final int METHOD_CALL_EXPRESSION
public static final int N_A
public static final int OBJECT_CREATION_EXPRESSION
public static final int PACKAGE
public static final int PARENTHESIZED_EXPRESSION
public static final int RETURN_STATEMENT
public static final int SIMPLE_REFERENCE
public static final int SUPER_EXPRESSION
public static final int SWITCH_GROUP
public static final int SWITCH_STATEMENT
public static final int SYNCHRONIZED_STATEMENT
public static final int THIS_EXPRESSION
public static final int THROW_SPECIFIER
public static final int THROW_STATEMENT
public static final int TRY_STATEMENT
public static final int TYPE
public static final int TYPE_EXPRESSION
public static final int UNARY_EXPRESSION
public static final int VARIABLE
public static final int VARIABLE_DECLARATION
public static final int WHILE_STATEMENT
| Method Detail |
public void addComment(AstComment comment)
public AstObject[] getChildren()
public AstComment[] getComments()
public AstCompilationUnit getCompilationUnit()
null if this type is not declared in a compilation unit
(for example, it is contained in a binary type or a compilation unit itself).public AstMethod getDeclaringMethod()
null if this object is not declared in a method
(for example, a field initializer).public AstType getDeclaringType()
null if this object is not declared in a type
(for example, a top-level type).public int getObjectKind()
public AstPackage getPackage()
null if this object is not declared in a package
(for example, a top-level package).public AstObject getParent()
null if this element has no parent.public AstSourcePosition getPosition()
null if this object has no associated
source code.public boolean isDeleted()
public void remove()
public void replaceWith(AstObject obj)
obj - object with which this object will be replaces
public void replaceWith(AstObject obj,
AstObject parent)
obj - object with which this object will be replacesparent - parent for the replaced objectpublic void setPosition(AstSourcePosition position)
position - specified source positionpublic void setPositionAfter(AstSourcePosition position)
position - specified source positionpublic void visitExpressions(AstExpressionVisitor visitor)
public void visitStatements(AstStatementVisitor visitor)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||