Example usage for org.eclipse.jdt.core.dom SingleMemberAnnotation resolveAnnotationBinding

List of usage examples for org.eclipse.jdt.core.dom SingleMemberAnnotation resolveAnnotationBinding

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom SingleMemberAnnotation resolveAnnotationBinding.

Prototype

public IAnnotationBinding resolveAnnotationBinding() 

Source Link

Document

Resolves and returns the resolved annotation for this annotation.

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.util.DOMFinder.java

License:Open Source License

public boolean visit(SingleMemberAnnotation node) {
    if (found(node, node) && this.resolveBinding)
        this.foundBinding = node.resolveAnnotationBinding();
    return true;/*  www  .  j a  v  a2  s  .  c  om*/
}

From source file:com.google.devtools.j2objc.ast.PropertyAnnotation.java

License:Apache License

public PropertyAnnotation(org.eclipse.jdt.core.dom.SingleMemberAnnotation jdtNode) {
    super(jdtNode);
    this.attributes = BindingUtil.parseAttributeString(jdtNode.resolveAnnotationBinding());
}

From source file:com.google.devtools.j2objc.types.BindingMapBuilder.java

License:Open Source License

@Override
public boolean visit(SingleMemberAnnotation node) {
    put(node, node.resolveAnnotationBinding());
    return true;
}

From source file:com.google.gwt.eclipse.core.validators.rpc.ValidationSuppressionVisitor.java

License:Open Source License

@Override
public boolean visit(SingleMemberAnnotation node) {
    IAnnotationBinding resolvedAnnotationBinding = node.resolveAnnotationBinding();
    processAnnotationBinding(resolvedAnnotationBinding);

    // Don't visit this node's children; they don't impact the result    
    return false;
}

From source file:edu.uci.ics.sourcerer.extractor.ast.ReferenceExtractorVisitor.java

License:Open Source License

/**
 * This method writes:/*w  w w. j  a  v  a 2  s .c  om*/
 *<ul>
 *  <li>For any single member annotation use:
 *  <ul>
 *    <li>Annotated by relation to <code>IRelationWriter</code>.</li>
 *  </ul></li>
 *</ul>
 */
@Override
public boolean visit(SingleMemberAnnotation node) {
    // Get the fqn
    String fqn = null;
    IAnnotationBinding binding = node.resolveAnnotationBinding();
    if (binding == null) {
        fqn = getUnknownFqn(node.getTypeName().getFullyQualifiedName());
    } else {
        ITypeBinding typeBinding = binding.getAnnotationType();
        if (typeBinding == null) {
            fqn = getUnknownFqn(binding.getName());
        } else {
            fqn = getTypeFqn(typeBinding);
        }
    }

    // Write the annotates relation
    relationWriter.writeAnnotatedBy(fqnStack.getFqn(), fqn, getLocation(node));

    return true;
}

From source file:edu.uci.ics.sourcerer.tools.java.extractor.eclipse.ReferenceExtractorVisitor.java

License:Open Source License

/**
 * This method writes://from www . ja  va2s.  c o  m
 *<ul>
 *  <li>For any single member annotation use:
 *  <ul>
 *    <li>Annotated by relation to <code>IRelationWriter</code>.</li>
 *  </ul></li>
 *</ul>
 */
@Override
public boolean visit(SingleMemberAnnotation node) {
    // Get the fqn
    String fqn = null;
    IAnnotationBinding binding = node.resolveAnnotationBinding();
    if (binding == null) {
        fqn = createUnknownFqn(node.getTypeName().getFullyQualifiedName());
    } else {
        ITypeBinding typeBinding = binding.getAnnotationType();
        if (typeBinding == null) {
            fqn = createUnknownFqn(binding.getName());
        } else {
            fqn = getTypeFqn(typeBinding);
        }
    }

    // Write the annotates relation
    relationWriter.writeRelation(Relation.ANNOTATED_BY, fqnStack.getFqn(), fqn, createLocation(node));

    return true;
}

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public SingleMemberAnnotation convert(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation annotation) {
    final SingleMemberAnnotation singleMemberAnnotation = new SingleMemberAnnotation(this.ast);
    setTypeNameForAnnotation(annotation, singleMemberAnnotation);
    singleMemberAnnotation.setValue(convert(annotation.memberValue));
    int start = annotation.sourceStart;
    int end = annotation.declarationSourceEnd;
    singleMemberAnnotation.setSourceRange(start, end - start + 1);
    if (this.resolveBindings) {
        recordNodes(singleMemberAnnotation, annotation);
        singleMemberAnnotation.resolveAnnotationBinding();
    }/*from  w  ww . j a v  a2 s  . c  o  m*/
    return singleMemberAnnotation;
}

From source file:org.jboss.tools.seam.internal.core.scanner.java.PackageInfoRequestor.java

License:Open Source License

public boolean visit(SingleMemberAnnotation node) {
    IAnnotationBinding b = node.resolveAnnotationBinding();
    if (b != null) {
        String type = b.getAnnotationType().getQualifiedName();
        if (IMPORT_ANNOTATION_TYPE.equals(type)) {
            List<String> is = ComponentBuilder.getArrayValue(node);
            for (String s : is) {
                SeamImport i = new SeamImport();
                i.setSeamPackage(s);/*from   ww  w. j ava 2 s.  co  m*/
                imports.add(i);
            }
        }
    }
    return true;
}

From source file:org.jboss.tools.ws.jaxrs.core.jdt.MemberValuePairLocationRetriever.java

License:Open Source License

/**
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
 *///ww w  .j  a  v  a 2s . c o  m
@Override
public boolean visit(SingleMemberAnnotation node) {
    final IAnnotationBinding annotationBinding = node.resolveAnnotationBinding();
    if (annotationBinding != null) {
        final String nodeName = annotationBinding.getAnnotationType().getQualifiedName();
        if (nodeName.equals(this.annotationName)) {
            this.locatedSourceRange = new SourceRange(node.getValue().getStartPosition(),
                    node.getValue().getLength());
        }
    }
    return false;
}

From source file:org.jboss.tools.ws.jaxrs.ui.contentassist.TypedRegionVisitor.java

License:Open Source License

/**
 * {@inheritDoc}//from  w ww  . j  a va2s. c o  m
 *  (non-Javadoc)
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
 */
@Override
public boolean visit(SingleMemberAnnotation node) {
    int startPosition = node.getStartPosition();
    int endPosition = startPosition + node.getLength();
    if (startPosition <= offset && offset <= endPosition) {
        binding = node.resolveAnnotationBinding();
    }
    return super.visit(node);
}