com.pnfsoftware.jeb.core.units.code.java.IJavaElement |
Known Indirect Subclasses |
Top-level interface for all elements of a Java Abstract Syntax Tree.
Each AST element implements this interface or one of the sub-interfaces.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FLAG_BUILT | ||||||||||
int | FLAG_FIELD_REFERENCES_OUTERCLASS | ||||||||||
int | FLAG_LAMBDA_CLASS | ||||||||||
int | FLAG_LAMBDA_IMPL | ||||||||||
int | FLAG_OPTIONAL_RENDERING | ||||||||||
int | FLAG_SECOND_PARAMETER_IS_OUTER_REF | ||||||||||
int | FLAG_STICKY |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
addFlags(int f)
Add flags to the current list of flags on this element.
| ||||||||||
abstract Object |
addTag(String key, Object value)
Add a tag.
| ||||||||||
abstract boolean |
canCauseException()
This non-recursive method indicates whether or not this element may be the cause of an
exception.
| ||||||||||
abstract void |
collectAllPhysicalOffsets(Collection<Integer> physicalOffsets)
Collect physical offsets for this element and all its constituents.
| ||||||||||
abstract IJavaElement |
duplicate()
Duplicate this element.
| ||||||||||
abstract void |
generate(JavaOutputSink out)
Generate this AST element recursively into a sink.
| ||||||||||
abstract Object |
getData(Object key)
Retrieve a piece of data attached to this AST element.
| ||||||||||
abstract JavaElementType |
getElementType()
This method returns the type of Java AST element held by this object.
| ||||||||||
abstract int |
getFlags()
Retrieve the flags set on this element.
| ||||||||||
abstract String | getOrigin() | ||||||||||
abstract int |
getPhysicalOffset()
Retrieve the low-level offset that map to this AST element.
| ||||||||||
abstract JavaReconAnon | getReconAnon() | ||||||||||
abstract JavaReconEnum | getReconEnum() | ||||||||||
abstract JavaReconEnummap | getReconEnummap() | ||||||||||
abstract JavaReconLambda | getReconLambda() | ||||||||||
abstract List<IJavaElement> |
getSubElements()
Get the list of AST elements that constitute this AST element.
| ||||||||||
abstract Map<String, Object> |
getTags()
Get a read-only collection of the current tag map.
| ||||||||||
abstract boolean |
hasFlags(int f)
Determine whether any flags have been set on this element.
| ||||||||||
abstract boolean |
hasPhysicalOffset()
Determine whether a physical offset is attached to this element.
| ||||||||||
abstract boolean | isReconArtifact() | ||||||||||
abstract void |
removeFlags(int f)
Remove some flags from this element.
| ||||||||||
abstract Object |
removeTag(String key)
Remove a tag.
| ||||||||||
abstract boolean |
replaceSubElement(IJavaElement oldElement, IJavaElement newElement)
Replace one element by another one.
| ||||||||||
abstract void |
setData(String key, Object value)
Attach a piece of arbitrary data to this AST element.
| ||||||||||
abstract void |
setFlags(int f)
Set flags on this element.
| ||||||||||
abstract void | setLambdaRecon(JavaReconLambda recon) | ||||||||||
abstract void | setOrigin(String origin) | ||||||||||
abstract void |
setPhysicalOffset(int offset)
Set a low-level physical offset to this AST element.
| ||||||||||
abstract void | setReconAnon(JavaReconAnon recon) | ||||||||||
abstract void | setReconEnum(JavaReconEnum recon) | ||||||||||
abstract void | setReconEnummap(JavaReconEnummap recon) | ||||||||||
abstract String |
toShortString()
Generate a short-string version of this element.
| ||||||||||
abstract boolean |
visitDepthPost(IJVisitor visitor, IJavaElement parent, JVisitResults results, boolean doNotVisitBlocksInsideCompounds)
Depth-first search, post-order visit of an expression tree or sub-tree.
| ||||||||||
abstract boolean |
visitDepthPost(IJVisitor visitor)
Depth-first search, post-order visit of an expression tree or sub-tree.
| ||||||||||
abstract boolean |
visitDepthPost(IJVisitor visitor, IJavaElement parent)
Depth-first search, post-order visit of an expression tree or sub-tree.
| ||||||||||
abstract boolean |
visitDepthPost(IJVisitor visitor, IJavaElement parent, JVisitResults results)
Depth-first search, post-order visit of an expression tree or sub-tree.
| ||||||||||
abstract boolean |
visitDepthPre(IJVisitor visitor, IJavaElement parent)
Visit this AST tree.
| ||||||||||
abstract boolean |
visitDepthPre(IJVisitor visitor)
Visit this AST tree.
| ||||||||||
abstract boolean |
visitDepthPre(IJVisitor visitor, IJavaElement parent, JVisitResults results)
Visit this AST tree.
|
Add flags to the current list of flags on this element. See FLAG_xxx
for a list of
legal flags.
This non-recursive method indicates whether or not this element may be the cause of an exception. In order to recursively check if the element throws (e.g., for a statement), use JUtil#canThrow(IStatement).
Collect physical offsets for this element and all its constituents. The first element
added
is for this one, followed by the
sub-elements's
.
physicalOffsets | output collection |
---|
Duplicate this element.
Generate this AST element recursively into a sink.
Retrieve a piece of data attached to this AST element.
This method returns the type of Java AST element held by this object.
Retrieve the flags set on this element. See FLAG_xxx
for a list of legal flags.
Retrieve the low-level offset that map to this AST element.
Get the list of AST elements that constitute this AST element. Typically, for simple statements, it may be expression. For complex expressions, it may be simpler expressions. For compound statements, it may more statements and expressions.
Note that type
and annotation
elements are not
returned by this method.
Get a read-only collection of the current tag map. Tags are special key-value pairs that can be attached to AST elements and rendered during AST generation.
Determine whether any flags have been set on this element. See FLAG_xxx
for a list of
legal flags.
Determine whether a physical offset is attached to this element.
Remove some flags from this element. See FLAG_xxx
for a list of legal flags.
Replace one element by another one. Only the references are compared, no equals/deep compare. At most one element is replaced.
Note that type
and annotation
elements cannot be
replaced using this method.
oldElement | the element to be replaced |
---|---|
newElement | the new element |
Attach a piece of arbitrary data to this AST element.
Set flags on this element. See FLAG_xxx
for a list of legal flags.
Set a low-level physical offset to this AST element.
Generate a short-string version of this element.
Depth-first search, post-order visit of an expression tree or sub-tree. The node being visited may be replaced without notifying the visitor.
visitor | the visitor object |
---|---|
doNotVisitBlocksInsideCompounds | true to avoid exploring the sub-blocks of
compound statements (e.g., if true, when visiting an
if-statements, the predicate expressions will be visited, but the if-blocks will
not) |
Depth-first search, post-order visit of an expression tree or sub-tree. The node being visited may be replaced without notifying the visitor.
visitor | the visitor object |
---|
Depth-first search, post-order visit of an expression tree or sub-tree. The node being visited may be replaced without notifying the visitor.
visitor | the visitor object |
---|
Depth-first search, post-order visit of an expression tree or sub-tree. The node being visited may be replaced without notifying the visitor.
visitor | the visitor object |
---|
Visit this AST tree. Processing of a node is done before visiting the children.
Visit this AST tree. Processing of a node is done before visiting the children.
Visit this AST tree. Processing of a node is done before visiting the children.