Class ListRewriteEvent
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent
org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ListRewriteEvent
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent
CHILDREN_CHANGED, INSERTED, REMOVED, REPLACED, UNCHANGED
-
Constructor Summary
ConstructorDescriptionListRewriteEvent(List originalNodes)
Creates a ListRewriteEvent from the original ASTNodes.ListRewriteEvent(RewriteEvent[] children)
Creates a ListRewriteEvent from existing rewrite events. -
Method Summary
Modifier and TypeMethodDescriptionint
int
getChangeKind(int index)
int
boolean
removeEntry(ASTNode originalEntry)
replaceEntry(ASTNode entry, ASTNode newEntry)
void
revertChange(NodeRewriteEvent event)
void
setNewValue(ASTNode newValue, int insertIndex)
toString()
-
Field Details
-
NEW
public static final int NEW- See Also:
- Constant Field Values
-
OLD
public static final int OLD- See Also:
- Constant Field Values
-
BOTH
public static final int BOTH- See Also:
- Constant Field Values
-
-
Constructor Details
-
ListRewriteEvent
Creates a ListRewriteEvent from the original ASTNodes. The resulting event represents the unmodified list.- Parameters:
originalNodes
- The original nodes (type ASTNode)
-
ListRewriteEvent
Creates a ListRewriteEvent from existing rewrite events.- Parameters:
children
- The rewrite events for this list.
-
-
Method Details
-
getChangeKind
public int getChangeKind()- Specified by:
getChangeKind
in classRewriteEvent
- Returns:
- Returns the event's change kind.
-
isListRewrite
public boolean isListRewrite()- Specified by:
isListRewrite
in classRewriteEvent
- Returns:
- Returns true if the given event is a list event.
-
getChildren
- Specified by:
getChildren
in classRewriteEvent
- Returns:
- Return the events describing the changes in a list. returns
null
if the event is not a list event.
-
getOriginalValue
- Specified by:
getOriginalValue
in classRewriteEvent
- Returns:
- Returns the original value. For lists this is a List of ASTNodes, for non-list
events this can be an ASTNode (for node properties), Integer (for an integer property),
Boolean (for boolean node properties) or properties like Operator.
null
is returned if the event is an insert event.
-
getNewValue
- Specified by:
getNewValue
in classRewriteEvent
- Returns:
- Returns the new value. For lists this is a List of ASTNodes, for non-list
events this can be an ASTNode (for node properties), Integer (for an integer property),
Boolean (for boolean node properties) or properties like Operator.
null
is returned if the event is a remove event.
-
removeEntry
-
replaceEntry
-
revertChange
-
getIndex
-
insert
-
setNewValue
-
getChangeKind
public int getChangeKind(int index) -
toString
-