Package org.eclipse.text.edits
Class TextEditVisitor
java.lang.Object
org.eclipse.text.edits.TextEditVisitor
A visitor for text edits.
For each different concrete text edit type T there is a method:
public boolean visit(T node)- Visits the given edit to perform some arbitrary operation. Iftrueis returned, the given edit's child edits will be visited next; however, iffalseis returned, the given edit's child edits will not be visited. The default implementation provided by this class calls a generic methodvisitNode(TextEdit node). Subclasses may reimplement these method as needed.
In addition, there are methods for visiting text edits in the abstract, regardless of node type:
public void preVisit(TextEdit edit)- Visits the given edit to perform some arbitrary operation. This method is invoked prior to the appropriate type-specificvisitmethod. The default implementation of this method does nothing. Subclasses may reimplement this method as needed.public void postVisit(TextEdit edit)- Visits the given edit to perform some arbitrary operation. This method is invoked after the appropriate type-specificendVisitmethod. The default implementation of this method does nothing. Subclasses may reimplement this method as needed.
For edits with children, the child nodes are visited in increasing order.
- Since:
- 3.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidVisits the given text edit following the type-specific visit (afterendVisit).voidVisits the given text edit prior to the type-specific visit.booleanvisit(CopyingRangeMarker edit) Visits aCopyingRangeMarkerinstance.booleanvisit(CopySourceEdit edit) Visits aCopySourceEditinstance.booleanvisit(CopyTargetEdit edit) Visits aCopyTargetEditinstance.booleanvisit(DeleteEdit edit) Visits aDeleteEditinstance.booleanvisit(InsertEdit edit) Visits aInsertEditinstance.booleanvisit(MoveSourceEdit edit) Visits aMoveSourceEditinstance.booleanvisit(MoveTargetEdit edit) Visits aMoveTargetEditinstance.booleanvisit(MultiTextEdit edit) Visits aMultiTextEditinstance.booleanvisit(RangeMarker edit) Visits aRangeMarkerinstance.booleanvisit(ReplaceEdit edit) Visits aReplaceEditinstance.booleanVisits aUndoEditinstance.booleanVisits the given text edit.
-
Constructor Details
-
TextEditVisitor
public TextEditVisitor()
-
-
Method Details
-
preVisit
Visits the given text edit prior to the type-specific visit. (beforevisit).The default implementation does nothing. Subclasses may reimplement.
- Parameters:
edit- the node to visit
-
postVisit
Visits the given text edit following the type-specific visit (afterendVisit).The default implementation does nothing. Subclasses may reimplement.
- Parameters:
edit- the node to visit
-
visitNode
Visits the given text edit. This method is called by default from type-specific visits. It is not called by an edit's accept method. The default implementation returnstrue.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aCopySourceEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aCopyTargetEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aMoveSourceEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aMoveTargetEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aRangeMarkerinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aCopyingRangeMarkerinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aDeleteEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aInsertEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aReplaceEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aUndoEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-
visit
Visits aMultiTextEditinstance.- Parameters:
edit- the node to visit- Returns:
- If
trueis returned, the given node's child nodes will be visited next; however, iffalseis returned, the given node's child nodes will not be visited.
-