Package org.aspectj.org.eclipse.jdt.internal.compiler.ast

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation


      } else {
        contents[contentsOffset++] = 0;
        contents[contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      contents[contentsOffset++] = 0;
      contents[contentsOffset++] = 1;
      if (contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = constantPool.literalIndex(VALUE);
      contents[contentsOffset++] = (byte) (elementNameIndex >> 8);
      contents[contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        contentsOffset = attributeOffset;
      } else {
        generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, attributeOffset);
      }
View Full Code Here


          }
        }
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      // this is a single member annotation (one member value)
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        throw new MissingImplementationException(
            "Please raise an AspectJ bug.  AspectJ does not know how to convert this annotation [" + annotation + "]");
      } else {
        AnnotationValue av = generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType);
        annotationAJ.addNameValuePair(new AnnotationNameValuePair(new String(
            singleMemberAnnotation.memberValuePairs()[0].name), av));
      }
    } else if (annotation instanceof MarkerAnnotation) {
      return;
    } else {
      // this is something else...
View Full Code Here

          } else {
            return kind;
          }
        } else if (annotation instanceof SingleMemberAnnotation) {
          // it is an @Aspect(...something...)
          SingleMemberAnnotation theAnnotation = (SingleMemberAnnotation) annotation;
          String clause = new String(((StringLiteral) theAnnotation.memberValue).source());// TODO
          // cast
          // safe
          // ?
          return determinePerClause(typeDeclaration, clause);
View Full Code Here

        throw new MissingImplementationException(
            "Please raise an AspectJ bug.  AspectJ does not know how to convert this annotation [" + annotation + "]");
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      // this is a single member annotation (one member value)
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        throw new MissingImplementationException(
            "Please raise an AspectJ bug.  AspectJ does not know how to convert this annotation [" + annotation + "]");
      } else {
        AnnotationValue av = generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType);
        annotationAJ.addNameValuePair(new AnnotationNameValuePair(new String(
            singleMemberAnnotation.memberValuePairs()[0].name), av));
      }
    } else if (annotation instanceof MarkerAnnotation) {
      MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation;
    } else {
      // this is a marker annotation (no member value pairs)
View Full Code Here

    return argName;
  }

  private String getStringLiteralFor(String memberName, Annotation inAnnotation, int[] location) {
    if (inAnnotation instanceof SingleMemberAnnotation && memberName.equals("value")) {
      SingleMemberAnnotation sma = (SingleMemberAnnotation) inAnnotation;
      if (sma.memberValue instanceof StringLiteral) {
        StringLiteral sv = (StringLiteral) sma.memberValue;
        location[0] = sv.sourceStart;
        location[1] = sv.sourceEnd;
        return new String(sv.source());
View Full Code Here

    for (int i = 0; i < this.annotations.length; i++) {
      if (new String(this.annotations[i].resolvedType.signature()).equals(SUPPRESSAJWARNINGS)) {
        if (this.annotations[i] instanceof MarkerAnnotation) {
          return true;
        } else if (this.annotations[i] instanceof SingleMemberAnnotation) {
          SingleMemberAnnotation sma = (SingleMemberAnnotation) this.annotations[i];
          if (sma.memberValue instanceof ArrayInitializer) {
            ArrayInitializer memberValue = (ArrayInitializer) sma.memberValue;
            for (int j = 0; j < memberValue.expressions.length; j++) {
              if (memberValue.expressions[j] instanceof StringLiteral) {
                StringLiteral val = (StringLiteral) memberValue.expressions[j];
View Full Code Here

    return argName;
  }

  private String getStringLiteralFor(String memberName, Annotation inAnnotation, int[] location) {
    if (inAnnotation instanceof SingleMemberAnnotation && memberName.equals("value")) {
      SingleMemberAnnotation sma = (SingleMemberAnnotation) inAnnotation;
      if (sma.memberValue instanceof StringLiteral) {
        StringLiteral sv = (StringLiteral) sma.memberValue;
        location[0] = sv.sourceStart;
        location[1] = sv.sourceEnd;
        return new String(sv.source());
View Full Code Here

                    } else {
                        return kind;
                    }
                } else if (annotation instanceof SingleMemberAnnotation) {
                    // it is an @Aspect(...something...)
                    SingleMemberAnnotation theAnnotation = (SingleMemberAnnotation)annotation;
                    String clause = new String(((StringLiteral)theAnnotation.memberValue).source());//TODO cast safe ?
                    return determinePerClause(typeDeclaration, clause);
                } else if (annotation instanceof NormalAnnotation) { // this kind if it was added by the visitor !
                   // it is an @Aspect(...something...)
                    NormalAnnotation theAnnotation = (NormalAnnotation)annotation;
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.