public final class RewriteEventStore
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RewriteEventStore.CopySourceInfo |
static interface |
RewriteEventStore.INodePropertyMapper
Interface that allows to override the way how children are accessed from
a parent.
|
static class |
RewriteEventStore.PropertyLocation |
| Modifier and Type | Field and Description |
|---|---|
static int |
BOTH |
static boolean |
DEBUG
Debug AST rewrite events.
|
static int |
NEW |
static int |
ORIGINAL |
| Constructor and Description |
|---|
RewriteEventStore() |
public static boolean DEBUG
If enabled, then ASTRewrite and ListRewrite
throw an IllegalArgumentException if a rewrite operation tries to insert an
AST node in a place where nodes of this type are not allowed (node type not a subtype of
the structural property's type).
Disabled by default, since this hasn't been enforced from the beginning, and there are clients (e.g. in JDT UI refactorings) that rely on a bit of leeway here. E.g. the qualifier of a QualifiedName cannot be a MethodInvocation expression or a SimpleType, but that's sometimes the easiest solution for such a change, and ASTRewrite has no problems with it.
public static final int NEW
public static final int ORIGINAL
public static final int BOTH
public void setNodePropertyMapper(RewriteEventStore.INodePropertyMapper nodePropertyMapper)
nodePropertyMapper - The new INodePropertyMapper or
null. to use the default.public void clear()
public void addEvent(ASTNode parent, StructuralPropertyDescriptor childProperty, RewriteEvent event)
public RewriteEvent getEvent(ASTNode parent, StructuralPropertyDescriptor property)
public NodeRewriteEvent getNodeEvent(ASTNode parent, StructuralPropertyDescriptor childProperty, boolean forceCreation)
public ListRewriteEvent getListEvent(ASTNode parent, StructuralPropertyDescriptor childProperty, boolean forceCreation)
public java.util.Iterator getChangeRootIterator()
public boolean hasChangedProperties(ASTNode parent)
public RewriteEventStore.PropertyLocation getPropertyLocation(java.lang.Object value, int kind)
public RewriteEvent findEvent(java.lang.Object value, int kind)
value - kind - null.public java.lang.Object getOriginalValue(ASTNode parent, StructuralPropertyDescriptor property)
public java.lang.Object getNewValue(ASTNode parent, StructuralPropertyDescriptor property)
public java.util.List getChangedPropertieEvents(ASTNode parent)
public int getChangeKind(ASTNode node)
public TextEditGroup getEventEditGroup(RewriteEvent event)
public void setEventEditGroup(RewriteEvent event, TextEditGroup editGroup)
public final TextEditGroup getTrackedNodeData(ASTNode node)
public void setTrackedNodeData(ASTNode node, TextEditGroup editGroup)
public final void markAsTracked(ASTNode node, TextEditGroup editGroup)
node - The node to trackeditGroup - Collects the range markers describing the node position.public final RewriteEventStore.CopySourceInfo markAsCopySource(ASTNode parent, StructuralPropertyDescriptor property, ASTNode node, boolean isMove)
public final boolean isRangeCopyPlaceholder(ASTNode node)
public final RewriteEventStore.CopySourceInfo createRangeCopy(ASTNode parent, StructuralPropertyDescriptor childProperty, ASTNode first, ASTNode last, boolean isMove, ASTNode internalPlaceholder, ASTNode replacingNode, TextEditGroup editGroup)
public RewriteEventStore.CopySourceInfo[] getNodeCopySources(ASTNode node)
public RewriteEventStore.CopySourceInfo[] internalGetCopySources(java.util.List copySources, ASTNode node)
public void prepareMovedNodes(TargetSourceRangeComputer sourceRangeComputer)
public void revertMovedNodes()
public boolean isInsertBoundToPrevious(ASTNode node)
public void setInsertBoundToPrevious(ASTNode node)
public java.lang.String toString()
toString in class java.lang.Objectpublic static boolean isNewNode(ASTNode node)