com.pnfsoftware.jeb.core.units.code.java.IJavaElement |
![]() |
Base interface for all elements of a Java Abstract Syntax Tree.
Each AST element implements this interface or one of the sub-interfaces, such as:
INonStatement
interface. Examples: method
,
constant
, static field
, etc.IStatement
interface. Examples: Assignment assignment, Continue
continue, WhileStm while, etc.Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
collectAllPhysicalOffsets(Collection<Integer> physicalOffsets)
Collect physical offsets for this element and all its constituents.
| ||||||||||
abstract JavaElementType |
getElementType()
This convenience method returns the type of Java AST element held by this object.
| ||||||||||
abstract int |
getPhysicalOffset()
Return the lowest-level offset that map to this AST element.
| ||||||||||
abstract List<? extends IJavaElement> |
getSubElements()
Get the list of AST elements that constitute this AST element.
| ||||||||||
abstract Map<String, Object> |
getTagMap()
Retrieve the tags associated to this element.
| ||||||||||
abstract boolean | hasPhysicalOffset() | ||||||||||
abstract boolean |
replaceSubElement(IJavaElement oldElement, IJavaElement newElement)
Replace one element by another one.
|
Collect physical offsets for this element and all its constituents. The first element
added
is for 'this' one, then getSubElements()
's.
physicalOffsets | output collection |
---|
This convenience method returns the type of Java AST element held by this object.
Return the lowest-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.
Retrieve the tags associated to this element. Clients may add, get, and remove tags directly from the returned map.
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 |