Class TypeSet.ExplicitImportResolver

  • All Implemented Interfaces:
    TypeSet.Resolver
    Enclosing class:
    TypeSet

    public static class TypeSet.ExplicitImportResolver
    extends TypeSet.AbstractResolver
    Resolver that tries to resolve the given simple class name with the explicit import statements.
    • Constructor Detail

      • ExplicitImportResolver

        public ExplicitImportResolver​(PMDASMClassLoader pmdClassLoader,
                                      java.util.Set<java.lang.String> importStmts)
        Parameters:
        pmdClassLoader - the class loader to use.
        importStmts - the import statements
    • Method Detail

      • resolve

        public java.lang.Class<?> resolve​(java.lang.String name)
                                   throws java.lang.ClassNotFoundException
        Description copied from interface: TypeSet.Resolver
        Resolve the class by the given name
        Parameters:
        name - the name of the class, might be fully classified or not.
        Returns:
        the class
        Throws:
        java.lang.ClassNotFoundException - if the class couldn't be found
      • couldResolve

        public boolean couldResolve​(java.lang.String name)
        Description copied from interface: TypeSet.Resolver
        Checks if the given class could be resolved by this resolver. Notice, that a resolver's ability to resolve a class does not imply that the class will actually be found and resolved.
        Specified by:
        couldResolve in interface TypeSet.Resolver
        Overrides:
        couldResolve in class TypeSet.AbstractResolver
        Parameters:
        name - the name of the class, might be fully classified or not.
        Returns:
        whether the class can be resolved