Package org.eclipse.jdt.core.dom

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


    }
    return -1;
  }

  private int getPackageStatementEndPos(CompilationUnit root) {
    PackageDeclaration packDecl= root.getPackage();
    if (packDecl != null) {
      int afterPackageStatementPos= -1;
      int lineNumber= root.getLineNumber(packDecl.getStartPosition() + packDecl.getLength());
      if (lineNumber >= 0) {
        int lineAfterPackage= lineNumber + 1;
        afterPackageStatementPos= root.getPosition(lineAfterPackage, 0);
      }
      if (afterPackageStatementPos < 0) {
        this.flags|= F_NEEDS_LEADING_DELIM;
        return packDecl.getStartPosition() + packDecl.getLength();
      }
      int firstTypePos= getFirstTypeBeginPos(root);
      if (firstTypePos != -1 && firstTypePos <= afterPackageStatementPos) {
        this.flags|= F_NEEDS_TRAILING_DELIM;
        if (firstTypePos == afterPackageStatementPos) {
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

         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

    return new TypeInfoAst(type).build();
  }

  @Override
  public PackageDeclaration newPackageDeclaration(AST ast) {
    PackageDeclaration declaration = ast.newPackageDeclaration();

    Name theName = ast.newName(name);
    declaration.setName(theName);

    return declaration;
  }
View Full Code Here

      return new SourceFileInfoPojo(this);
    }

    @Override
    public PackageInfo getPackageInfo() {
      PackageDeclaration ast = unit.getPackage();
      return PackageInfoPojo.of(jdt, ast);
    }
View Full Code Here

          .transform(toMetaType())
          .toImmutableList();
    }

    private Function<TypeDeclaration, TypeInfo> toMetaType() {
      PackageDeclaration packageDeclaration;
      packageDeclaration = unit.getPackage();

      PackageInfo metaPackage;
      metaPackage = PackageInfoPojo.of(jdt, packageDeclaration);
View Full Code Here

      return new SourceFileInfoPojo(this);
    }

    @Override
    public PackageInfo getPackageInfo() {
      PackageDeclaration ast = unit.getPackage();
      return PackageInfoPojo.of(ast);
    }
View Full Code Here

      return ImmutableList.copyOf(typeList);
    }

    private Function<TypeDeclaration, TypeInfo> toMetaType() {
      PackageDeclaration packageDeclaration;
      packageDeclaration = unit.getPackage();

      PackageInfo metaPackage;
      metaPackage = PackageInfoPojo.of(packageDeclaration);
View Full Code Here

      return new SourceFileInfoPojo(this);
    }

    @Override
    public PackageInfo getPackageInfo() {
      PackageDeclaration ast = unit.getPackage();
      return PackageInfoPojo.of(ast);
    }
View Full Code Here

      return ImmutableList.copyOf(typeList);
    }

    private Function<TypeDeclaration, TypeInfo> toMetaType() {
      PackageDeclaration packageDeclaration;
      packageDeclaration = unit.getPackage();

      PackageInfo metaPackage;
      metaPackage = PackageInfoPojo.of(packageDeclaration);
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.