Package org.eclipse.jdt.core.dom

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


    * Package modifiers
    */
   @Override
   public String getPackage()
   {
      PackageDeclaration pkg = unit.getPackage();
      if (pkg != null)
      {
         return pkg.getName().getFullyQualifiedName();
      }
      else
      {
         return null;
      }
View Full Code Here


         AnnotationTypeDeclaration annotationTypeDeclaration = (AnnotationTypeDeclaration) declaration;
         return new JavaAnnotationImpl(enclosingType, document, unit, annotationTypeDeclaration);
      }
      else if (declaration instanceof PackageDeclaration)
      {
         PackageDeclaration packageDeclaration = (PackageDeclaration) declaration;
         return new JavaPackageInfoImpl(enclosingType, document, unit, packageDeclaration);
      }
      else
      {
         throw new ParserException("Unknown Java source type [" + declaration + "]");
View Full Code Here

    * Package modifiers
    */
   @Override
   public String getPackage()
   {
      PackageDeclaration pkg = unit.getPackage();
      if (pkg != null)
      {
         return pkg.getName().getFullyQualifiedName();
      }
      else
      {
         return null;
      }
View Full Code Here

    * Package modifiers
    */
   @Override
   public String getPackage()
   {
      PackageDeclaration pkg = unit.getPackage();
      if (pkg != null)
      {
         return pkg.getName().getFullyQualifiedName();
      }
      else
      {
         return null;
      }
View Full Code Here

   *            the JDT Java AST
   * @param cu
   *            the generated Java compilation unit
   */
  private void generatePackage(Classifier clazz, AST ast, CompilationUnit cu) {
    PackageDeclaration pd = ast.newPackageDeclaration();
    String fullPackageName = getFullPackageName(clazz);
    pd.setName(ast.newName(fullPackageName));

    Date now = new Date();
    String commentDate = "Generation date: " + now.toString() + ".";

    interfaceGenerator.generatePackageJavadoc(ast, pd,
View Full Code Here

   *            the JDT Java AST
   * @param cu
   *            the generated Java compilation unit
   */
  public void generatePackage(Classifier clazz, AST ast, CompilationUnit cu) {
    PackageDeclaration pd = ast.newPackageDeclaration();
    String fullPackageName = getFullPackageName(clazz);
    pd.setName(ast.newName(fullPackageName));

    Date now = new Date();
    String commentDate = "Generation date: " + now.toString() + ".";

    generatePackageJavadoc(ast, pd, PackageComment.CONTENT_1.getValue(),
View Full Code Here

   *            the JDT Java AST
   * @param cu
   *            the generated Java compilation unit
   */
  public void generatePackage(Classifier clazz, AST ast, CompilationUnit cu) {
    PackageDeclaration pd = ast.newPackageDeclaration();
    String fullPackageName = getFullPackageName(clazz);
    pd.setName(ast.newName(fullPackageName));

    Date now = new Date();
    String commentDate = "Generation date: " + now.toString() + ".";

    interfaceGenerator.generatePackageJavadoc(ast, pd,
View Full Code Here

    AST ast = unit.getAST();

    // Package statement
    // package astexplorer;

    PackageDeclaration packageDeclaration = ast.newPackageDeclaration();
    unit.setPackage(packageDeclaration);
    // unit.se
    packageDeclaration.setName(ast.newSimpleName(fileName));
    // System.out.println("Filename: " + fileName);
    // class declaration
    // public class SampleComposite extends Composite {

    TypeDeclaration classType = ast.newTypeDeclaration();
View Full Code Here

    * Package modifiers
    */
   @Override
   public String getPackage()
   {
      PackageDeclaration pkg = unit.getPackage();
      if (pkg != null)
      {
         return pkg.getName().getFullyQualifiedName();
      }
      else
      {
         return null;
      }
View Full Code Here

  @Test
  public void test_Existing_Static_Imports2() {
    AST ast = AST.newAST(AST.JLS4);
    CompilationUnit cu = ast.newCompilationUnit();

    PackageDeclaration packageDeclaration = ast.newPackageDeclaration();
    packageDeclaration.setName(ast.newName("org.kissmda.test.junit"));
    cu.setPackage(packageDeclaration);

    ImportDeclaration importDeclaration = ast.newImportDeclaration();
    importDeclaration
        .setName(ast.newName("org.junit.Assert.assertNotNull"));
View Full Code Here

TOP

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

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.