Package org.eclipse.jdt.core.dom

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


  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

              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

   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

         convertTo(AnnotationType.SINGLE);
      }

      if (isSingleValue())
      {
         SingleMemberAnnotation sa = (SingleMemberAnnotation) annotation;

         String stub = "@" + getName() + "(" + value + ") public class Stub { }";
         JavaClass temp = (JavaClass) JavaParser.parse(stub);

         SingleMemberAnnotation anno = (SingleMemberAnnotation) temp.getAnnotations().get(0).getInternal();

         Expression expression = anno.getValue();
         sa.setValue((Expression) ASTNode.copySubtree(ast, expression));
      }
      else
      {
         setLiteralValue(DEFAULT_VALUE, value);
View Full Code Here

   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

         convertTo(AnnotationType.SINGLE);
      }

      if (isSingleValue())
      {
         SingleMemberAnnotation sa = (SingleMemberAnnotation) annotation;

         String stub = "@" + getName() + "(" + value + ") public class Stub { }";
         JavaClass<?> temp = Roaster.parse(JavaClass.class, stub);

         SingleMemberAnnotation anno = (SingleMemberAnnotation) temp.getAnnotations().get(0).getInternal();

         Expression expression = anno.getValue();
         sa.setValue((Expression) ASTNode.copySubtree(ast, expression));
      }
      else
      {
         setLiteralValue(DEFAULT_VALUE, value);
View Full Code Here

   @Override
   public AnnotationSource<O> getAnnotationValue()
   {
      if (isSingleValue())
      {
         SingleMemberAnnotation single = (SingleMemberAnnotation) annotation;
         Expression value = single.getValue();
         if (value instanceof org.eclipse.jdt.core.dom.Annotation)
         {
            return new Nested(this, value);
         }
      }
View Full Code Here

   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

         convertTo(AnnotationType.SINGLE);
      }

      if (isSingleValue())
      {
         SingleMemberAnnotation sa = (SingleMemberAnnotation) annotation;

         String stub = "@" + getName() + "(" + value + ") public class Stub { }";
         JavaClass temp = (JavaClass) JavaParser.parse(stub);

         SingleMemberAnnotation anno = (SingleMemberAnnotation) temp.getAnnotations().get(0).getInternal();

         Expression expression = anno.getValue();
         sa.setValue((Expression) ASTNode.copySubtree(ast, expression));
      }
      else
      {
         setLiteralValue(DEFAULT_VALUE, value);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.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.