Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.FieldDeclaration.modifiers()


          }

          addImportToCompilationUnit(annotation.getCanonicalName(), cu);
         
          Annotation modifier = createModifier(cu.getAST(), annotation, properties, cu);
          field.modifiers().add(0, modifier);
        }
      }

    } catch (CoreException e) {
      warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.4"), annotation.getCanonicalName(), targetField, targetClass)); //$NON-NLS-1$
View Full Code Here


      FieldDeclaration fieldDeclaration = typeDeclaration.getAST().newFieldDeclaration(variableDeclaration);
      Type type = JDTUtils.createQualifiedType(compilationUnit.getAST(), fieldType);
      fieldDeclaration.setType(type);
      Modifier privateModifier = fieldDeclaration.getAST().newModifier(ModifierKeyword.PRIVATE_KEYWORD);
      fieldDeclaration.modifiers().add(privateModifier);
      typeDeclaration.bodyDeclarations().add(fieldDeclaration);
    } catch (Exception e) {
      warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.11"), fieldName, targetClass)); //$NON-NLS-1$
    }
View Full Code Here

            warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.1"), annotation.getCanonicalName(), targetClass + "." + varibleDeclaration.getName().toString())); //$NON-NLS-1$
            return;
          }
         
          Annotation modifier = createModifier(cu.getAST(), annotation, properties, cu);
          field.modifiers().add(0, modifier);

          addImportToCompilationUnit(annotation.getCanonicalName(), cu);
        }
      }
    } catch (JavaModelException e) {
View Full Code Here

        final FieldDeclaration originalFieldDeclaration = (FieldDeclaration) this.removedFieldNodes
            .get(constantField);

        // Get annotations.
        final Collection annotationCollection = new LinkedHashSet();
        for (final Iterator mit = originalFieldDeclaration.modifiers()
            .iterator(); mit.hasNext();) {
          final Object o = mit.next();
          if (o instanceof Annotation) {
            final Annotation oldAnnotation = (Annotation) o;
            final Annotation newAnnotation = (Annotation) ASTNode
View Full Code Here

    NumberLiteral initializer = ast.newNumberLiteral();
    initializer.setToken("1L");
    fragment.setInitializer(initializer);

    FieldDeclaration fieldDeclaration = ast.newFieldDeclaration(fragment);
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
View Full Code Here

    fragment.setInitializer(initializer);

    FieldDeclaration fieldDeclaration = ast.newFieldDeclaration(fragment);
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
    fieldDeclaration.setType(ast.newPrimitiveType(PrimitiveType.LONG));
View Full Code Here

    FieldDeclaration fieldDeclaration = ast.newFieldDeclaration(fragment);
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
    fieldDeclaration.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
    fieldDeclaration.setType(ast.newPrimitiveType(PrimitiveType.LONG));

    td.bodyDeclarations().add(fieldDeclaration);
  }
View Full Code Here

        FieldDeclaration fieldDeclaration = ast
            .newFieldDeclaration(fieldId);

        Modifier m = getAccessModifier(vis);
        if (m != null)
          fieldDeclaration.modifiers().add(m);

        Type t = getType(type);
        fieldDeclaration.setType(t);

        // inicializa o field
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.