Java Code Examples for org.eclipse.jdt.core.search.IJavaSearchConstants#ANNOTATION_TYPE_REFERENCE

The following examples show how to use org.eclipse.jdt.core.search.IJavaSearchConstants#ANNOTATION_TYPE_REFERENCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeReferencePattern.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int limitTo, char typeSuffix, int matchRule) {
	this(qualification, simpleName,matchRule);
	this.typeSuffix = typeSuffix;
	if (typeSignature != null) {
		// store type signatures and arguments
		this.typeSignatures = Util.splitTypeLevelsSignature(typeSignature);
		setTypeArguments(Util.getAllTypeArguments(this.typeSignatures));
		if (hasTypeArguments()) {
			this.segmentsSize = getTypeArguments().length + CharOperation.occurencesOf('/', this.typeSignatures[0]) - 1;
		}
	}
    this.fineGrain = limitTo & 0xFFFFFFF0;
    if (this.fineGrain == IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) {
    	this.categories = CATEGORIES_ANNOT_REF;
    }
}
 
Example 2
Source File: MatchLocatorParser.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void consumeMarkerAnnotation(boolean isTypeAnnotation) {
	super.consumeMarkerAnnotation(isTypeAnnotation);
	if (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) {
		Annotation annotation = (Annotation) (isTypeAnnotation ? this.typeAnnotationStack[this.typeAnnotationPtr] : this.expressionStack[this.expressionPtr]);
		this.patternLocator.match(annotation, this.nodeSet);
	}
}
 
Example 3
Source File: MatchLocatorParser.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void consumeNormalAnnotation(boolean isTypeAnnotation) {
	super.consumeNormalAnnotation(isTypeAnnotation);
	if (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) {
		// this is always an Annotation
		Annotation annotation = (Annotation) (isTypeAnnotation ? this.typeAnnotationStack[this.typeAnnotationPtr] : this.expressionStack[this.expressionPtr]);
		this.patternLocator.match(annotation, this.nodeSet);
	}
}
 
Example 4
Source File: MatchLocatorParser.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) {
	super.consumeSingleMemberAnnotation(isTypeAnnotation);
	if (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) {
		// this is always an Annotation
		Annotation annotation = (Annotation) (isTypeAnnotation ? this.typeAnnotationStack[this.typeAnnotationPtr] : this.expressionStack[this.expressionPtr]);
		this.patternLocator.match(annotation, this.nodeSet);
	}
}
 
Example 5
Source File: JavaSearchPattern.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @param fineGrain
 */
public static String getFineGrainFlagString(final int fineGrain) {
	if (fineGrain == 0) {
		return "none"; //$NON-NLS-1$
	}
	StringBuffer buffer = new StringBuffer();
	for (int i=1; i<=32; i++) {
		int bit = fineGrain & (1<<(i-1));
		if (bit != 0 && buffer.length()>0) buffer.append(" | "); //$NON-NLS-1$
		switch (bit) {
			case IJavaSearchConstants.FIELD_DECLARATION_TYPE_REFERENCE:
				buffer.append("FIELD_DECLARATION_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE:
				buffer.append("LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.PARAMETER_DECLARATION_TYPE_REFERENCE:
				buffer.append("PARAMETER_DECLARATION_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE:
				buffer.append("SUPERTYPE_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE:
				buffer.append("THROWS_CLAUSE_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.CAST_TYPE_REFERENCE:
				buffer.append("CAST_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.CATCH_TYPE_REFERENCE:
				buffer.append("CATCH_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE:
				buffer.append("CLASS_INSTANCE_CREATION_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.RETURN_TYPE_REFERENCE:
				buffer.append("RETURN_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE:
				buffer.append("IMPORT_DECLARATION_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE:
				buffer.append("ANNOTATION_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.TYPE_ARGUMENT_TYPE_REFERENCE:
				buffer.append("TYPE_ARGUMENT_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE:
				buffer.append("TYPE_VARIABLE_BOUND_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE:
				buffer.append("WILDCARD_BOUND_TYPE_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.SUPER_REFERENCE:
				buffer.append("SUPER_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.QUALIFIED_REFERENCE:
				buffer.append("QUALIFIED_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.THIS_REFERENCE:
				buffer.append("THIS_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.IMPLICIT_THIS_REFERENCE:
				buffer.append("IMPLICIT_THIS_REFERENCE"); //$NON-NLS-1$
				break;
			case IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION:
				buffer.append("METHOD_REFERENCE_EXPRESSION"); //$NON-NLS-1$
				break;
		}
	}
	return buffer.toString();
}