Eclipse JDT
2.0

org.eclipse.jdt.core.dom
Class ASTMatcher

java.lang.Object
  |
  +--org.eclipse.jdt.core.dom.ASTMatcher

public class ASTMatcher
extends Object

Concrete superclass and default implementation of an AST subtree matcher.

For example, to compute whether two ASTs subtrees are structurally isomorphic, use n1.subtreeMatch(new ASTMatcher(), n2) where n1 and n2 are the AST root nodes of the subtrees.

For each different concrete AST node type T there is a public boolean match(T node, Object other) method that matches the given node against another object (typically another AST node, although this is not essential). The default implementations provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. For nodes with list-valued properties, the child nodes within the list are compared in order. For nodes with multiple properties, the child nodes are compared in the order that most closely corresponds to the lexical reading order of the source program. For instance, for a type declaration node, the child ordering is: name, superclass, superinterfaces, and body declarations.

Subclasses may override (extend or reimplement) some or all of the match methods in order to define more specialized subtree matchers.

Since:
2.0
See Also:
ASTNode.subtreeMatch(org.eclipse.jdt.core.dom.ASTMatcher, java.lang.Object)

Constructor Summary
ASTMatcher()
          Creates a new AST matcher.
 
Method Summary
 boolean match(AnonymousClassDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ArrayAccess node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ArrayCreation node, Object other)
          Returns whether the given node and the other object object match.
 boolean match(ArrayInitializer node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ArrayType node, Object other)
          Returns whether the given node and the other object match.
 boolean match(AssertStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(Assignment node, Object other)
          Returns whether the given node and the other object match.
 boolean match(Block node, Object other)
          Returns whether the given node and the other object match.
 boolean match(BooleanLiteral node, Object other)
          Returns whether the given node and the other object match.
 boolean match(BreakStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(CastExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(CatchClause node, Object other)
          Returns whether the given node and the other object match.
 boolean match(CharacterLiteral node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ClassInstanceCreation node, Object other)
          Returns whether the given node and the other object match.
 boolean match(CompilationUnit node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ConditionalExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ConstructorInvocation node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ContinueStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(DoStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(EmptyStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ExpressionStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(FieldAccess node, Object other)
          Returns whether the given node and the other object match.
 boolean match(FieldDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ForStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(IfStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ImportDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(InfixExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(Initializer node, Object other)
          Returns whether the given node and the other object match.
 boolean match(InstanceofExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(Javadoc node, Object other)
          Returns whether the given node and the other object match.
 boolean match(LabeledStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(MethodDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(MethodInvocation node, Object other)
          Returns whether the given node and the other object match.
 boolean match(NullLiteral node, Object other)
          Returns whether the given node and the other object match.
 boolean match(NumberLiteral node, Object other)
          Returns whether the given node and the other object match.
 boolean match(PackageDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ParenthesizedExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(PostfixExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(PrefixExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(PrimitiveType node, Object other)
          Returns whether the given node and the other object match.
 boolean match(QualifiedName node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ReturnStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SimpleName node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SimpleType node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SingleVariableDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(StringLiteral node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SuperConstructorInvocation node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SuperFieldAccess node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SuperMethodInvocation node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SwitchCase node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SwitchStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(SynchronizedStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ThisExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(ThrowStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(TryStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(TypeDeclaration node, Object other)
          Returns whether the given node and the other object match.
 boolean match(TypeDeclarationStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(TypeLiteral node, Object other)
          Returns whether the given node and the other object match.
 boolean match(VariableDeclarationExpression node, Object other)
          Returns whether the given node and the other object match.
 boolean match(VariableDeclarationFragment node, Object other)
          Returns whether the given node and the other object match.
 boolean match(VariableDeclarationStatement node, Object other)
          Returns whether the given node and the other object match.
 boolean match(WhileStatement node, Object other)
          Returns whether the given node and the other object match.
static boolean safeEquals(Object o1, Object o2)
          Returns whether the given objects are equal according to equals.
 boolean safeSubtreeListMatch(List list1, List list2)
          Returns whether the given lists of AST nodes match pair wise according to ASTNode.subtreeMatch.
 boolean safeSubtreeMatch(Object node1, Object node2)
          Returns whether the given nodes match according to AST.subtreeMatch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTMatcher

public ASTMatcher()
Creates a new AST matcher.

Method Detail

safeSubtreeListMatch

public final boolean safeSubtreeListMatch(List list1,
                                          List list2)
Returns whether the given lists of AST nodes match pair wise according to ASTNode.subtreeMatch.

Note that this is a convenience method, useful for writing recursive subtree matchers.

Parameters:
list1 - the first list of AST nodes (element type: ASTNode)
list2 - the second list of AST nodes (element type: ASTNode)
Returns:
true if the lists have the same number of elements and match pair-wise according to ASTNode.subtreeMatch
See Also:
ASTNode.subtreeMatch(ASTMatcher matcher, Object other)

safeSubtreeMatch

public final boolean safeSubtreeMatch(Object node1,
                                      Object node2)
Returns whether the given nodes match according to AST.subtreeMatch. Returns false if one or the other of the nodes are null. Returns true if both nodes are null.

Note that this is a convenience method, useful for writing recursive subtree matchers.

Parameters:
node1 - the first AST node, or null; must be an instance of ASTNode
node2 - the second AST node, or null; must be an instance of ASTNode
Returns:
true if the nodes match according to AST.subtreeMatch or both are null, and false otherwise
See Also:
ASTNode.subtreeMatch(ASTMatcher, Object)

safeEquals

public static boolean safeEquals(Object o1,
                                 Object o2)
Returns whether the given objects are equal according to equals. Returns false if either node is null.

Parameters:
o1 - the first object, or null
o2 - the second object, or null
Returns:
true if the nodes are equal according to equals or both null, and false otherwise

match

public boolean match(AnonymousClassDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ArrayAccess node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ArrayCreation node,
                     Object other)
Returns whether the given node and the other object object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ArrayInitializer node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ArrayType node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(AssertStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(Assignment node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(Block node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(BooleanLiteral node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(BreakStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(CastExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(CatchClause node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(CharacterLiteral node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ClassInstanceCreation node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(CompilationUnit node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ConditionalExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ConstructorInvocation node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ContinueStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(DoStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(EmptyStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ExpressionStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(FieldAccess node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(FieldDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ForStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(IfStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ImportDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(InfixExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(InstanceofExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(Initializer node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(Javadoc node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(LabeledStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(MethodDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(MethodInvocation node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(NullLiteral node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(NumberLiteral node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(PackageDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ParenthesizedExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(PostfixExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(PrefixExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(PrimitiveType node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(QualifiedName node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ReturnStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SimpleName node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SimpleType node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SingleVariableDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(StringLiteral node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SuperConstructorInvocation node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SuperFieldAccess node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SuperMethodInvocation node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SwitchCase node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SwitchStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(SynchronizedStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ThisExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(ThrowStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(TryStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(TypeDeclaration node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(TypeDeclarationStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(TypeLiteral node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(VariableDeclarationExpression node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(VariableDeclarationFragment node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(VariableDeclarationStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

match

public boolean match(WhileStatement node,
                     Object other)
Returns whether the given node and the other object match.

The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.

Parameters:
node - the node
other - the other object, or null
Returns:
true if the subtree matches, or false if they do not match or the other object has a different node type or is null

Eclipse JDT
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.