java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent
org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ListRewriteEvent

public class ListRewriteEvent extends RewriteEvent
  • Field Details

  • Constructor Details

    • ListRewriteEvent

      public ListRewriteEvent(List originalNodes)
      Creates a ListRewriteEvent from the original ASTNodes. The resulting event represents the unmodified list.
      Parameters:
      originalNodes - The original nodes (type ASTNode)
    • ListRewriteEvent

      public ListRewriteEvent(RewriteEvent[] children)
      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 class RewriteEvent
      Returns:
      Returns the event's change kind.
    • isListRewrite

      public boolean isListRewrite()
      Specified by:
      isListRewrite in class RewriteEvent
      Returns:
      Returns true if the given event is a list event.
    • getChildren

      public RewriteEvent[] getChildren()
      Specified by:
      getChildren in class RewriteEvent
      Returns:
      Return the events describing the changes in a list. returns null if the event is not a list event.
    • getOriginalValue

      public Object getOriginalValue()
      Specified by:
      getOriginalValue in class RewriteEvent
      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

      public Object getNewValue()
      Specified by:
      getNewValue in class RewriteEvent
      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

      public RewriteEvent removeEntry(ASTNode originalEntry)
    • replaceEntry

      public RewriteEvent replaceEntry(ASTNode entry, ASTNode newEntry)
    • revertChange

      public void revertChange(NodeRewriteEvent event)
    • getIndex

      public int getIndex(ASTNode node, int kind)
    • insert

      public RewriteEvent insert(ASTNode insertedNode, int insertIndex)
    • setNewValue

      public void setNewValue(ASTNode newValue, int insertIndex)
    • getChangeKind

      public int getChangeKind(int index)
    • toString

      public String toString()
      Overrides:
      toString in class Object