Examples of bodyDeclarations()


Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

        commit.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        commit.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        classDeclaration.bodyDeclarations().add(commit);

        // Add a restore method.
        MethodDeclaration restore = ast.newMethodDeclaration();
        restore.setName(ast.newSimpleName(_getRestoreMethodName(false)));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

        restore.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        restore.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        classDeclaration.bodyDeclarations().add(restore);

        // Add a get checkpoint method.
        MethodDeclaration getCheckpoint = ast.newMethodDeclaration();
        String checkpointType = getClassName(Checkpoint.class, state, root);
        getCheckpoint.setName(ast
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

        getCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        getCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        classDeclaration.bodyDeclarations().add(getCheckpoint);

        // Add a set checkpoint method.
        MethodDeclaration setCheckpoint = ast.newMethodDeclaration();
        setCheckpoint.setName(ast
                .newSimpleName(_getSetCheckpointMethodName(false)));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

        setCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        setCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        classDeclaration.bodyDeclarations().add(setCheckpoint);

        classDeclaration.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        return classDeclaration;
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

      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

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

                continue;
            }
            if (index < 0) {
                return type;
            }
            return searchTypeDeclaration(type.bodyDeclarations(), innerClassName);
        }
        return null;
    }

    @CheckForNull
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

    SingleVariableDeclaration var = ast.newSingleVariableDeclaration();
    var.setType(ast.newSimpleType(ast.newSimpleName("String")));
    var.setName(ast.newSimpleName("a"));
    md.parameters().add(var);
    td.bodyDeclarations().add(md);

    Block block = ast.newBlock();
    md.setBody(block);

    MethodInvocation mi = ast.newMethodInvocation();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

      if ((typeDeclaration.getFlags() & ASTNode.MALFORMED) != 0) {
        createdNodeSource = generateSyntaxIncorrectAST();
        if (this.createdNode == null)
          throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
      } else {
        List bodyDeclarations = typeDeclaration.bodyDeclarations();
        if (bodyDeclarations.size() == 0) {
          throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
        }
        this.createdNode = (ASTNode) bodyDeclarations.iterator().next();
        createdNodeSource = this.source;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

  buff.append(lineSeparator).append('}');
  ASTParser parser = ASTParser.newParser(AST.JLS8);
  parser.setSource(buff.toString().toCharArray());
  CompilationUnit compilationUnit = (CompilationUnit) parser.createAST(null);
  TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().iterator().next();
  List bodyDeclarations = typeDeclaration.bodyDeclarations();
  if (bodyDeclarations.size() != 0)
    this.createdNode = (ASTNode) bodyDeclarations.iterator().next();
  return buff.toString();
}
/**
 
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

    SingleVariableDeclaration var = ast.newSingleVariableDeclaration();
    var.setType(ast.newSimpleType(ast.newSimpleName("String")));
    var.setName(ast.newSimpleName("a"));
    md.parameters().add(var);
    td.bodyDeclarations().add(md);

    Block block = ast.newBlock();
    md.setBody(block);

    MethodInvocation mi = ast.newMethodInvocation();
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.