Class ASTImportDeclaration

    • Method Detail

      • setImportOnDemand

        @InternalApi
        @Deprecated
        public void setImportOnDemand()
        Deprecated.
        Will be made private with 7.0.0
      • isImportOnDemand

        public boolean isImportOnDemand()
        Returns true if this is an import-on-demand declaration, aka "wildcard import".
        • If this is a static import, then the imported names are those of the accessible static members of the named type;
        • Otherwise, the imported names are the names of the accessible types of the named type or named package.
      • isStatic

        public boolean isStatic()
        Returns true if this is a static import. If this import is not on-demand, getImportedSimpleName() returns the name of the imported member.
      • getImportedNameNode

        @Deprecated
        public ASTName getImportedNameNode()
        Deprecated.
        this will be removed with PMD 7.0.0
      • getImportedName

        public String getImportedName()
        Returns the full name of the import. For on-demand imports, this is the name without the final dot and asterisk.
      • getImportedSimpleName

        public String getImportedSimpleName()
        Returns the simple name of the type or method imported by this declaration. For on-demand imports, returns null.
      • getPackageName

        public String getPackageName()
        Returns the "package" prefix of the imported name. For type imports, including on-demand imports, this is really the package name of the imported type(s). For static imports, this is actually the qualified name of the enclosing type, including the type name.
      • getPackage

        @Deprecated
        public Package getPackage()
        Deprecated.
        this will be removed with PMD 7.0.0
        Returns the Package instance representing the package of the type or method imported by this declaration. This may be null if the auxclasspath is not correctly set, as this method depends on correct type resolution.