Examples of SingleMemberAnnotation


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

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

          }
        }
      }
    } 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

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

          } 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

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

        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

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

    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

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

    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

Examples of org.eclipse.jdt.core.dom.SingleMemberAnnotation

          " Found " + baseAnno.toString() + " without an array.");
    List<Expression> realAnnos = null;
    List<ICrystalAnnotation> crystalAnnos = new ArrayList<ICrystalAnnotation>();
   
    if (baseAnno.isSingleMemberAnnotation()) {
      SingleMemberAnnotation anno = (SingleMemberAnnotation)baseAnno;
      if (!(anno.getValue() instanceof ArrayInitializer)) {
        realAnnos = Collections.singletonList(anno.getValue());
      }
      else {
        realAnnos = ((ArrayInitializer)anno.getValue()).expressions();
     
    }
    else if (baseAnno.isNormalAnnotation()) {
      NormalAnnotation anno = (NormalAnnotation)baseAnno;
      for (MemberValuePair pair : (List<MemberValuePair>)anno.values()) {
        if (pair.getName().getIdentifier().equals("annos") && pair.getValue() instanceof ArrayInitializer) {
          realAnnos = ((ArrayInitializer) pair.getValue()).expressions();
          break;
        }
      }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.SingleMemberAnnotation

  private void updateModifier(TypeDeclaration aRemoteService) {
    List modifiers = aRemoteService.modifiers();
    for (Iterator m = modifiers.iterator(); m.hasNext();) {
      Object modifier = m.next();
      if (modifier instanceof SingleMemberAnnotation) {
        SingleMemberAnnotation annotation = (SingleMemberAnnotation) modifier;
        if (annotation.getTypeName().getFullyQualifiedName().equals("RemoteServiceRelativePath")) {
          modifiers.remove(modifier);
          break;
        }
      }
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.SingleMemberAnnotation

              ASTNode aNode = a
                  .findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);

              if (aNode instanceof SingleMemberAnnotation) {
                SingleMemberAnnotation sma = (SingleMemberAnnotation) aNode;
                Expression val = sma.getValue();
                parseAnnotationListElement(elems,
                    annotationName, nameProp, colProp, val);
              }
            }
          } else if (ia.getElementName().equals(annotationName)) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.SingleMemberAnnotation

   public String getLiteralValue() throws IllegalStateException
   {
      String result = null;
      if (isSingleValue())
      {
         SingleMemberAnnotation sm = (SingleMemberAnnotation) annotation;
         result = sm.getValue().toString();
      }
      else if (isNormal())
      {
         List<ValuePair> values = getValues();
         for (ValuePair pair : values)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.