Examples of BodyDeclaration


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

        }

        _openBrace();
        _output("\n");

        BodyDeclaration prev = null;
        Iterator it;

        for (it = node.bodyDeclarations().iterator(); it.hasNext();) {
            BodyDeclaration d = (BodyDeclaration) it.next();

            if (prev instanceof EnumConstantDeclaration) {
                // enum constant declarations do not include punctuation
                if (d instanceof EnumConstantDeclaration) {
                    // enum constant declarations are separated by commas
                    _output(", ");
                } else {
                    // semicolon separates last enum constant declaration from
                    // first class body declarations
                    _output("; ");
                }
            }

            d.accept(this);
        }

        _checkComments((node.getStartPosition() + node.getLength()) - 1);
        _closeBrace();
        _output("\n");
View Full Code Here

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

   *      java.lang.Class, java.util.Map)
   */
  public void addClassAnnotation(String targetClass, Class<? extends java.lang.annotation.Annotation> annotation, Map<String, Object> properties) {
    try {
      CompilationUnit cu = compilationUnitCache.getCompilationUnit(targetClass);
      BodyDeclaration typeDeclaration = compilationUnitCache.getTypeDeclaration(targetClass);

      if (isAnnotationAlreadyUsedOnDeclaration(annotation, typeDeclaration)) {
        warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.1"), annotation.getCanonicalName(), targetClass)); //$NON-NLS-1$
        return;
      }

      addImportToCompilationUnit(annotation.getCanonicalName(), cu);
      Annotation modifier = createModifier(cu.getAST(), annotation, properties, cu);
      typeDeclaration.modifiers().add(0, modifier);
    } catch (Exception e) {
      warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.2"), annotation.getCanonicalName(), targetClass)); //$NON-NLS-1$
    }
  }
View Full Code Here

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

    }
  }

  public void removeAbstractModifierFromClass(String targetClass) {
    try {
      BodyDeclaration typeDeclaration = compilationUnitCache.getTypeDeclaration(targetClass);
      removeAbstractModifier(typeDeclaration.modifiers());
    } catch (Exception e) {
      warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.6"), targetClass)); //$NON-NLS-1$
    }
  }
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.