blob: 7a1b38c9f4abe56dac37d3c3507c8651f280e6a6 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2002 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.core.dom;
class CopyPositionsMatcher extends ASTMatcher {
private void copyPositions(ASTNode source, ASTNode destination) {
destination.setSourceRange(source.getStartPosition(), source.getLength());
}
/*
* @see ASTMatcher#match(ArrayType, Object)
*/
public boolean match(ArrayType node, Object other) {
copyPositions(node, (ASTNode) other);
return super.match(node, other);
}
/*
* @see ASTMatcher#match(QualifiedName, Object)
*/
public boolean match(QualifiedName node, Object other) {
copyPositions(node, (ASTNode) other);
return super.match(node, other);
}
/*
* @see ASTMatcher#match(SimpleName, Object)
*/
public boolean match(SimpleName node, Object other) {
copyPositions(node, (ASTNode) other);
return super.match(node, other);
}
/*
* @see ASTMatcher#match(SimpleType, Object)
*/
public boolean match(SimpleType node, Object other) {
copyPositions(node, (ASTNode) other);
return super.match(node, other);
}
/*
* @see ASTMatcher#match(PrimitiveType, Object)
*/
public boolean match(PrimitiveType node, Object other) {
copyPositions(node, (ASTNode) other);
return super.match(node, other);
}
}