Package org.eclipse.jdt.core.dom

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


   }

   @SuppressWarnings("unchecked")
   private void convertTo(final AnnotationType type)
   {
      BodyDeclaration node = (BodyDeclaration) annotation.getParent();
      String value = this.getLiteralValue();

      for (Object o : node.modifiers())
      {
         if (o.equals(annotation))
         {
            node.modifiers().remove(annotation);
            Annotation<O> na = new AnnotationImpl<O, T>(parent, type);
            na.setName(getName());
            annotation = (org.eclipse.jdt.core.dom.Annotation) na.getInternal();
            node.modifiers().add(annotation);
            break;
         }
      }

      if (!AnnotationType.MARKER.equals(type) && (value != null))
View Full Code Here


  protected Object[] doGetElements(TypeDeclaration typeDeclaration) {
   
    Map<String,NakedObjectCollection> membersByName = new TreeMap<String,NakedObjectCollection>();
    for(Object bodyDeclarationObj: typeDeclaration.bodyDeclarations()) {
     
      BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarationObj;
      if (!(bodyDeclaration instanceof MethodDeclaration)) {
        continue;
      }
     
      MethodDeclaration methodDeclaration = (MethodDeclaration)bodyDeclaration;
View Full Code Here

  protected Object[] doGetElements(TypeDeclaration typeDeclaration) {
   
    Map<String,NakedObjectAction> membersByName = new TreeMap<String,NakedObjectAction>();
    for(Object bodyDeclarationObj: typeDeclaration.bodyDeclarations()) {
     
      BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarationObj;
      if (!(bodyDeclaration instanceof MethodDeclaration)) {
        continue;
      }
     
      MethodDeclaration methodDeclaration = (MethodDeclaration)bodyDeclaration;
View Full Code Here

        appendMethods(type, methodsByName);

        Map<String,NakedObjectMember> membersByName = new TreeMap<String,NakedObjectMember>();
        for(Object bodyDeclarationObj: typeDeclaration.bodyDeclarations()) {
           
            BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarationObj;
            if (!(bodyDeclaration instanceof MethodDeclaration)) {
                continue;
            }
           
            MethodDeclaration methodDeclaration = (MethodDeclaration)bodyDeclaration;
View Full Code Here

    CompilationUnit parsedCompilationUnit = getEditorTracker().getParsedCompilationUnit();
    if (parsedCompilationUnit == null) {
      return;
    }
   
    BodyDeclaration newDeclaration =
      AstUtils.findDeclaration(
        parsedCompilationUnit, searchDeclaration );
    if (newDeclaration == null) {
      return;
    }
View Full Code Here

  protected Object[] doGetElements(TypeDeclaration typeDeclaration) {
   
    Map<String,NakedObjectProperty> membersByName = new TreeMap<String,NakedObjectProperty>();
    for(Object bodyDeclarationObj: typeDeclaration.bodyDeclarations()) {
     
      BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarationObj;
      if (!(bodyDeclaration instanceof MethodDeclaration)) {
        continue;
      }
     
      MethodDeclaration methodDeclaration = (MethodDeclaration)bodyDeclaration;
View Full Code Here

   public <NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType(NESTED_TYPE type)
   {
      if (type instanceof AbstractJavaSource)
      {
         List<Object> bodyDeclarations = getBodyDeclaration().bodyDeclarations();
         BodyDeclaration nestedBody = ((AbstractJavaSource<?>) type).body;
         bodyDeclarations.add(ASTNode.copySubtree(unit.getAST(), nestedBody));
      }
      else
      {
         throw new IllegalArgumentException("type must be an AbstractJavaSource instance");
View Full Code Here

   @Override
   public O removeNestedType(JavaSource<?> type)
   {
      if (type instanceof AbstractJavaSource)
      {
         BodyDeclaration bodyDeclaration = ((AbstractJavaSource<?>) type).body;
         List<Object> bodyDeclarations = getBodyDeclaration().bodyDeclarations();
         bodyDeclarations.remove(bodyDeclaration);
      }
      return (O) this;
   }
View Full Code Here

    printModifiers(node.modifiers());
    this.buffer.append("@interface ");//$NON-NLS-1$
    node.getName().accept(this);
    this.buffer.append(" {");//$NON-NLS-1$
    for (Iterator it = node.bodyDeclarations().iterator(); it.hasNext(); ) {
      BodyDeclaration d = (BodyDeclaration) it.next();
      d.accept(this);
    }
    this.buffer.append("}\n");//$NON-NLS-1$
    return false;
  }
View Full Code Here

   */
  public boolean visit(AnonymousClassDeclaration node) {
    this.buffer.append("{\n");//$NON-NLS-1$
    this.indent++;
    for (Iterator it = node.bodyDeclarations().iterator(); it.hasNext(); ) {
      BodyDeclaration b = (BodyDeclaration) it.next();
      b.accept(this);
    }
    this.indent--;
    printIndent();
    this.buffer.append("}\n");//$NON-NLS-1$
    return false;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.BodyDeclaration

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.