public int resolveLevel(ASTNode possibleMatchingNode) { if (this.pattern.findReferences) { if (possibleMatchingNode instanceof SingleTypeReference) { return resolveLevel(((SingleTypeReference) possibleMatchingNode).resolvedType); } } if (this.pattern.findDeclarations) { if (possibleMatchingNode instanceof TypeParameter) { return matchTypeParameter(((TypeParameter) possibleMatchingNode).binding, true); } } return IMPOSSIBLE_MATCH; }
@Override public int match(TypeReference node, MatchingNodeSet nodeSet) { if (this.pattern.findReferences) { if (node instanceof SingleTypeReference) { // Type parameter cannot be qualified if (matchesName(this.pattern.name, ((SingleTypeReference) node).token)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } } return IMPOSSIBLE_MATCH; }
public int resolveLevel(Binding binding) { if (binding == null) return INACCURATE_MATCH; if (!(binding instanceof TypeVariableBinding)) return IMPOSSIBLE_MATCH; return matchTypeParameter((TypeVariableBinding) binding, true); }
public static PatternLocator patternLocator(SearchPattern pattern) { switch (pattern.kind) { case IIndexConstants.PKG_REF_PATTERN : return new PackageReferenceLocator((PackageReferencePattern) pattern); case IIndexConstants.PKG_DECL_PATTERN : return new PackageDeclarationLocator((PackageDeclarationPattern) pattern); case IIndexConstants.TYPE_REF_PATTERN : return new TypeReferenceLocator((TypeReferencePattern) pattern); case IIndexConstants.TYPE_DECL_PATTERN : return new TypeDeclarationLocator((TypeDeclarationPattern) pattern); case IIndexConstants.SUPER_REF_PATTERN : return new SuperTypeReferenceLocator((SuperTypeReferencePattern) pattern); case IIndexConstants.CONSTRUCTOR_PATTERN : return new ConstructorLocator((ConstructorPattern) pattern); case IIndexConstants.FIELD_PATTERN : return new FieldLocator((FieldPattern) pattern); case IIndexConstants.METHOD_PATTERN : return new MethodLocator((MethodPattern) pattern); case IIndexConstants.OR_PATTERN : return new OrLocator((OrPattern) pattern); case IIndexConstants.AND_PATTERN : return new AndLocator((AndPattern) pattern); case IIndexConstants.LOCAL_VAR_PATTERN : return new LocalVariableLocator((LocalVariablePattern) pattern); case IIndexConstants.TYPE_PARAM_PATTERN: return new TypeParameterLocator((TypeParameterPattern) pattern); } return null; } public static char[] qualifiedPattern(char[] simpleNamePattern, char[] qualificationPattern) {
@Override public int match(TypeParameter node, MatchingNodeSet nodeSet) { if (this.pattern.findDeclarations) { if (matchesName(this.pattern.name, node.name)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } return IMPOSSIBLE_MATCH; }
public int resolveLevel(Binding binding) { if (binding == null) return INACCURATE_MATCH; if (!(binding instanceof TypeVariableBinding)) return IMPOSSIBLE_MATCH; return matchTypeParameter((TypeVariableBinding) binding, true); }
public static PatternLocator patternLocator(SearchPattern pattern) { switch (pattern.kind) { case IIndexConstants.PKG_REF_PATTERN : return new PackageReferenceLocator((PackageReferencePattern) pattern); case IIndexConstants.PKG_DECL_PATTERN : return new PackageDeclarationLocator((PackageDeclarationPattern) pattern); case IIndexConstants.TYPE_REF_PATTERN : return new TypeReferenceLocator((TypeReferencePattern) pattern); case IIndexConstants.TYPE_DECL_PATTERN : return new TypeDeclarationLocator((TypeDeclarationPattern) pattern); case IIndexConstants.SUPER_REF_PATTERN : return new SuperTypeReferenceLocator((SuperTypeReferencePattern) pattern); case IIndexConstants.CONSTRUCTOR_PATTERN : return new ConstructorLocator((ConstructorPattern) pattern); case IIndexConstants.FIELD_PATTERN : return new FieldLocator((FieldPattern) pattern); case IIndexConstants.METHOD_PATTERN : return new MethodLocator((MethodPattern) pattern); case IIndexConstants.OR_PATTERN : return new OrLocator((OrPattern) pattern); case IIndexConstants.AND_PATTERN : return new AndLocator((AndPattern) pattern); case IIndexConstants.LOCAL_VAR_PATTERN : return new LocalVariableLocator((LocalVariablePattern) pattern); case IIndexConstants.TYPE_PARAM_PATTERN: return new TypeParameterLocator((TypeParameterPattern) pattern); } return null; } public static char[] qualifiedPattern(char[] simpleNamePattern, char[] qualificationPattern) {
public int resolveLevel(ASTNode possibleMatchingNode) { if (this.pattern.findReferences) { if (possibleMatchingNode instanceof SingleTypeReference) { return resolveLevel(((SingleTypeReference) possibleMatchingNode).resolvedType); } } if (this.pattern.findDeclarations) { if (possibleMatchingNode instanceof TypeParameter) { return matchTypeParameter(((TypeParameter) possibleMatchingNode).binding, true); } } return IMPOSSIBLE_MATCH; }
public int match(TypeReference node, MatchingNodeSet nodeSet) { if (this.pattern.findReferences) { if (node instanceof SingleTypeReference) { // Type parameter cannot be qualified if (matchesName(this.pattern.name, ((SingleTypeReference) node).token)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } } return IMPOSSIBLE_MATCH; }
public int resolveLevel(Binding binding) { if (binding == null) return INACCURATE_MATCH; if (!(binding instanceof TypeVariableBinding)) return IMPOSSIBLE_MATCH; return matchTypeParameter((TypeVariableBinding) binding, true); }
public static PatternLocator patternLocator(SearchPattern pattern) { switch (pattern.kind) { case IIndexConstants.PKG_REF_PATTERN : return new PackageReferenceLocator((PackageReferencePattern) pattern); case IIndexConstants.PKG_DECL_PATTERN : return new PackageDeclarationLocator((PackageDeclarationPattern) pattern); case IIndexConstants.TYPE_REF_PATTERN : return new TypeReferenceLocator((TypeReferencePattern) pattern); case IIndexConstants.TYPE_DECL_PATTERN : return new TypeDeclarationLocator((TypeDeclarationPattern) pattern); case IIndexConstants.SUPER_REF_PATTERN : return new SuperTypeReferenceLocator((SuperTypeReferencePattern) pattern); case IIndexConstants.CONSTRUCTOR_PATTERN : return new ConstructorLocator((ConstructorPattern) pattern); case IIndexConstants.FIELD_PATTERN : return new FieldLocator((FieldPattern) pattern); case IIndexConstants.METHOD_PATTERN : return new MethodLocator((MethodPattern) pattern); case IIndexConstants.OR_PATTERN : return new OrLocator((OrPattern) pattern); case IIndexConstants.AND_PATTERN : return new AndLocator((AndPattern) pattern); case IIndexConstants.LOCAL_VAR_PATTERN : return new LocalVariableLocator((LocalVariablePattern) pattern); case IIndexConstants.TYPE_PARAM_PATTERN: return new TypeParameterLocator((TypeParameterPattern) pattern); } return null; } public static char[] qualifiedPattern(char[] simpleNamePattern, char[] qualificationPattern) {
public int resolveLevel(ASTNode possibleMatchingNode) { if (this.pattern.findReferences) { if (possibleMatchingNode instanceof SingleTypeReference) { return resolveLevel(((SingleTypeReference) possibleMatchingNode).resolvedType); } } if (this.pattern.findDeclarations) { if (possibleMatchingNode instanceof TypeParameter) { return matchTypeParameter(((TypeParameter) possibleMatchingNode).binding, true); } } return IMPOSSIBLE_MATCH; }
public int match(TypeReference node, MatchingNodeSet nodeSet) { if (this.pattern.findReferences) { if (node instanceof SingleTypeReference) { // Type parameter cannot be qualified if (matchesName(this.pattern.name, ((SingleTypeReference) node).token)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } } return IMPOSSIBLE_MATCH; }
@Override public int resolveLevel(Binding binding) { if (binding == null) return INACCURATE_MATCH; if (!(binding instanceof TypeVariableBinding)) return IMPOSSIBLE_MATCH; return matchTypeParameter((TypeVariableBinding) binding, true); }
public static PatternLocator patternLocator(SearchPattern pattern) { switch (pattern.kind) { case IIndexConstants.PKG_REF_PATTERN : return new PackageReferenceLocator((PackageReferencePattern) pattern); case IIndexConstants.PKG_DECL_PATTERN : return new PackageDeclarationLocator((PackageDeclarationPattern) pattern); case IIndexConstants.TYPE_REF_PATTERN : return new TypeReferenceLocator((TypeReferencePattern) pattern); case IIndexConstants.TYPE_DECL_PATTERN : return new TypeDeclarationLocator((TypeDeclarationPattern) pattern); case IIndexConstants.SUPER_REF_PATTERN : return new SuperTypeReferenceLocator((SuperTypeReferencePattern) pattern); case IIndexConstants.CONSTRUCTOR_PATTERN : return new ConstructorLocator((ConstructorPattern) pattern); case IIndexConstants.FIELD_PATTERN : return new FieldLocator((FieldPattern) pattern); case IIndexConstants.METHOD_PATTERN : return new MethodLocator((MethodPattern) pattern); case IIndexConstants.OR_PATTERN : return new OrLocator((OrPattern) pattern); case IIndexConstants.AND_PATTERN : return new AndLocator((AndPattern) pattern); case IIndexConstants.LOCAL_VAR_PATTERN : return new LocalVariableLocator((LocalVariablePattern) pattern); case IIndexConstants.TYPE_PARAM_PATTERN: return new TypeParameterLocator((TypeParameterPattern) pattern); } return null; } public static char[] qualifiedPattern(char[] simpleNamePattern, char[] qualificationPattern) {
public int resolveLevel(ASTNode possibleMatchingNode) { if (this.pattern.findReferences) { if (possibleMatchingNode instanceof SingleTypeReference) { return resolveLevel(((SingleTypeReference) possibleMatchingNode).resolvedType); } } if (this.pattern.findDeclarations) { if (possibleMatchingNode instanceof TypeParameter) { return matchTypeParameter(((TypeParameter) possibleMatchingNode).binding, true); } } return IMPOSSIBLE_MATCH; }
public int match(TypeParameter node, MatchingNodeSet nodeSet) { if (this.pattern.findDeclarations) { if (matchesName(this.pattern.name, node.name)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } return IMPOSSIBLE_MATCH; }
public int resolveLevel(Binding binding) { if (binding == null) return INACCURATE_MATCH; if (!(binding instanceof TypeVariableBinding)) return IMPOSSIBLE_MATCH; return matchTypeParameter((TypeVariableBinding) binding, true); }
return new LocalVariableLocator((LocalVariablePattern) pattern); case IIndexConstants.TYPE_PARAM_PATTERN: return new TypeParameterLocator((TypeParameterPattern) pattern); case IIndexConstants.MODULE_PATTERN: return new ModuleLocator((ModulePattern) pattern);
public int resolveLevel(ASTNode possibleMatchingNode) { if (this.pattern.findReferences) { if (possibleMatchingNode instanceof SingleTypeReference) { return resolveLevel(((SingleTypeReference) possibleMatchingNode).resolvedType); } } if (this.pattern.findDeclarations) { if (possibleMatchingNode instanceof TypeParameter) { return matchTypeParameter(((TypeParameter) possibleMatchingNode).binding, true); } } return IMPOSSIBLE_MATCH; }