Package org.eclipse.jdt.core.dom

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


               {
                  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();
      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 = (JavaClass) JavaParser.parse(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

   {
      if (isNormal())
      {
         NormalAnnotation normal = (NormalAnnotation) annotation;
         @SuppressWarnings("unchecked")
         List<MemberValuePair> values = normal.values();
         for (MemberValuePair memberValuePair : values)
         {
            if (Strings.areEqual(name, memberValuePair.getName().getIdentifier()))
            {
               return new Nested(this, memberValuePair.getValue());
View Full Code Here

    for (IExtendedModifier m : modifiers) {
      if (m.isAnnotation()) {
        Annotation a = (Annotation) m;
        if ("Test".equals(a.getTypeName().toString()) && a instanceof NormalAnnotation) {
          NormalAnnotation na = (NormalAnnotation) a;
          for (Object o : na.values()) {
            MemberValuePair mvp = (MemberValuePair) o;
            if (mvp.getName().toString().equals(attribute)) return mvp;
          }
        }
      }
View Full Code Here

      NormalAnnotation test = ast.newNormalAnnotation();
      test.setTypeName(ast.newName("Test"));
      MemberValuePair mvp = ast.newMemberValuePair();
      mvp.setName(ast.newSimpleName("enabled"));
      mvp.setValue(ast.newBooleanLiteral(false));
      test.values().add(mvp);
      result.remove(ignored, null);
      ListRewrite lr = result.getListRewrite(md, MethodDeclaration.MODIFIERS2_PROPERTY);
      lr.insertFirst(test, null);
    }
View Full Code Here

    if (attributes != null) {
      for (Entry<String, Boolean> a : attributes.entrySet()) {
        MemberValuePair mvp = ast.newMemberValuePair();
        mvp.setName(ast.newSimpleName(a.getKey()));
        mvp.setValue(ast.newBooleanLiteral(a.getValue()));
        normalAnnotation.values().add(mvp);
      }
    }
    return result;
  }
View Full Code Here

    ASTNode node = ((SourceRefElement) iAnnotation).findNode(assistContext.getASTRoot());
    annotation = (Annotation) node;
    if (node instanceof NormalAnnotation) {
      NormalAnnotation normalAnnotation = (NormalAnnotation) node;
      @SuppressWarnings("unchecked")
      List<MemberValuePair> pairs = normalAnnotation.values();

      for (MemberValuePair pair : pairs) {
        Expression value = pair.getValue();
        if (value instanceof TypeLiteral) {
          if (isWithinRange(value, invocationOffset)) {
View Full Code Here

    ASTNode node = ((SourceRefElement) iAnnotation).findNode(assistContext.getASTRoot());
    annotation = (Annotation) node;
    if (node instanceof NormalAnnotation) {
      NormalAnnotation normalAnnotation = (NormalAnnotation) node;
      @SuppressWarnings("unchecked")
      List<MemberValuePair> pairs = normalAnnotation.values();

      for (MemberValuePair pair : pairs) {
        Expression value = pair.getValue();
        if (value instanceof StringLiteral) {
          if (isWithinRange(value, invocationOffset)) {
View Full Code Here

      LocationInformation locationInfo = null;
      if (node instanceof NormalAnnotation) {
        NormalAnnotation normalAnnotation = (NormalAnnotation) node;
        @SuppressWarnings("unchecked")
        List<MemberValuePair> pairs = normalAnnotation.values();

        for (MemberValuePair pair : pairs) {
          Expression expression = pair.getValue();
          if (expression instanceof StringLiteral) {
            locationInfo = getLocationInformation((StringLiteral) expression, javaContext);
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.