public interface

IJavaElement

com.pnfsoftware.jeb.core.units.code.java.IJavaElement
Known Indirect Subclasses

Class Overview

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:

Summary

Public Methods
abstract JavaElementType getElementType()
This convenience method returns the type of Java AST element held by this object.
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 replaceSubElement(IJavaElement oldElement, IJavaElement newElement)
Replace one element by another one.

Public Methods

public abstract JavaElementType getElementType ()

This convenience method returns the type of Java AST element held by this object.

public abstract List<? extends IJavaElement> getSubElements ()

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. Etc.

Returns
  • the list of constituting elements, may be empty but never null

public abstract Map<String, Object> getTagMap ()

Retrieve the tags associated to this element. Clients may add, get, and remove tags directly from the returned map.

Returns
  • a dictionary of string to object entries

public abstract boolean replaceSubElement (IJavaElement oldElement, IJavaElement newElement)

Replace one element by another one. Only the references are compared, no equals/deep compare. At most one element is replaced.

Parameters
oldElement the element to be replaced
newElement the new element