Interface Classpath

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Classpath
    Classpath abstraction. PMD's symbol resolver uses the classpath to find class files.
    • Method Detail

      • findResource

        @Nullable URL findResource​(String resourcePath)
        Returns a URL to load the given resource if it exists in this classpath. Otherwise returns null. This will typically be used to find Java class files. A typical input would be java/lang/String.class.
        Parameters:
        resourcePath - Resource path, as described in ClassLoader.getResource(String)
        Returns:
        A URL if the resource exists, otherwise null
      • exclude

        default Classpath exclude​(Set<String> deletedEntries)
        Return a classpath that will ignore the given classpath entries, even if they are present in this classpath. Every call to findResource(String) is otherwise delegated to this one.
        Parameters:
        deletedEntries - Set of resource paths to exclude
      • contextClasspath

        static Classpath contextClasspath()