1
/********************************************************************
2
* Copyright (c) 2010 Contributors. All rights reserved.
3
* This program and the accompanying materials are made available
4
* under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution and is available at
6
* http://eclipse.org/legal/epl-v10.html
8
* Contributors: Nieraj Singh - initial implementation
9
*******************************************************************/
10
package org.aspectj.org.eclipse.jdt.core.dom;
12
import java.util.List;
14
public class BindingTypePattern extends IdentifierTypePattern {
16
private FormalBinding formalBinding;
18
public BindingTypePattern(AST ast, FormalBinding formalBinding) {
20
this.formalBinding = formalBinding;
21
setTypePatternExpression(generateTypePatternExpression(this.formalBinding));
24
List<?> internalStructuralPropertiesForType(int apiLevel) {
28
public FormalBinding getFormalBinding() {
32
ASTNode clone0(AST target) {
33
ASTNode node = new BindingTypePattern(target,
34
(FormalBinding) getFormalBinding().clone(target));
35
node.setSourceRange(getStartPosition(), getLength());
39
boolean subtreeMatch0(ASTMatcher matcher, Object other) {
40
if (matcher instanceof AjASTMatcher) {
41
AjASTMatcher ajmatcher = (AjASTMatcher) matcher;
42
return ajmatcher.match(this, other);
47
void accept0(ASTVisitor visitor) {
48
if (visitor instanceof AjASTVisitor) {
49
AjASTVisitor ajVisitor = (AjASTVisitor) visitor;
50
boolean visited = ajVisitor.visit(this);
53
ajVisitor.visit(getFormalBinding());
55
ajVisitor.endVisit(this);
59
protected String generateTypePatternExpression(FormalBinding formalBinding) {
60
String expression = super.generateTypePatternExpression(formalBinding
62
expression += expression + " " + formalBinding.getBinding();