Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.NormalAnnotation.values()


        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


      ASTNode aNode = a
          .findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);
      if (aNode instanceof NormalAnnotation) {
        NormalAnnotation aA = (NormalAnnotation) aNode;
        List values = aA.values();
        for (Object exp : values) {
          if (exp instanceof MemberValuePair) {
            MemberValuePair mvp = (MemberValuePair) exp;
            String paramName = mvp.getName()
                .getFullyQualifiedName();
View Full Code Here

  private Expression getAnnotationElement(Expression na, String name) {
    if (na instanceof StringLiteral) {
      return na;
    } else if (na instanceof NormalAnnotation) {
      NormalAnnotation nan = (NormalAnnotation) na;
      List val = nan.values();
      for (Object v : val) {
        if (v instanceof MemberValuePair) {
          MemberValuePair mvp = (MemberValuePair) v;
          if (mvp.getName().toString().startsWith(name)) {
            return mvp.getValue();
View Full Code Here

      if (annotation.isNormalAnnotation())
      {
         NormalAnnotation na = (NormalAnnotation) annotation;

         List<MemberValuePair> toBeRemoved = new ArrayList<MemberValuePair>();
         for (Object v : na.values())
         {
            if (v instanceof MemberValuePair)
            {
               MemberValuePair pair = (MemberValuePair) v;
               if (pair.getValue().toString().equals(name))
View Full Code Here

               {
                  toBeRemoved.add(pair);
               }
            }
         }
         na.values().removeAll(toBeRemoved);

         if ((getLiteralValue() != null) && (getValues().size() == 1))
         {
            convertTo(AnnotationType.SINGLE);
         }
View Full Code Here

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

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

      for (Object v : anno.values())
      {
         if (v instanceof MemberValuePair)
         {
            na.values().add(ASTNode.copySubtree(annotation.getAST(), (MemberValuePair) v));
         }
View Full Code Here

      if (annotation.isNormalAnnotation())
      {
         NormalAnnotation na = (NormalAnnotation) annotation;

         List<MemberValuePair> toBeRemoved = new ArrayList<MemberValuePair>();
         for (Object v : na.values())
         {
            if (v instanceof MemberValuePair)
            {
               MemberValuePair pair = (MemberValuePair) v;
               if (pair.getName().toString().equals(name))
View Full Code Here

               {
                  toBeRemoved.add(pair);
               }
            }
         }
         na.values().removeAll(toBeRemoved);

         if ((getLiteralValue() != null) && (getValues().size() == 1))
         {
            convertTo(AnnotationType.SINGLE);
         }
View Full Code Here

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

      NormalAnnotation anno = (NormalAnnotation) temp.getAnnotations().get(0).getInternal();
      MemberValuePair mvp = (MemberValuePair) anno.values().get(0);

      List<MemberValuePair> values = na.values();
      ListIterator<MemberValuePair> iter = values.listIterator();
      while (iter.hasNext())
      {
View Full Code Here

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

      NormalAnnotation anno = (NormalAnnotation) temp.getAnnotations().get(0).getInternal();
      MemberValuePair mvp = (MemberValuePair) anno.values().get(0);

      @SuppressWarnings("unchecked")
      List<MemberValuePair> values = ((NormalAnnotation) annotation).values();
      ListIterator<MemberValuePair> iter = values.listIterator();
      while (iter.hasNext())
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.