Interface IClassPath

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    ClassPathImpl

    public interface IClassPath
    extends java.lang.AutoCloseable
    A classpath from which resources (classes and other files) may be loaded. Essentially, this is just a list of codebases.
    Author:
    David Hovemeyer
    • Method Detail

      • addCodeBase

        void addCodeBase​(ICodeBase codeBase)
        Add a codebase. The object will be interrogated to determine whether it is an application codebase or an auxiliary codebase. Application codebases must be scannable.
        Parameters:
        codeBase - the codebase to add
      • appCodeBaseIterator

        java.util.Iterator<? extends ICodeBase> appCodeBaseIterator()
        Return an iterator over the application codebases.
        Returns:
        iterator over the application codebases
      • auxCodeBaseIterator

        java.util.Iterator<? extends ICodeBase> auxCodeBaseIterator()
        Return an iterator over the auxiliary codebases.
        Returns:
        iterator over the auxiliary codebases
      • mapResourceNameToCodeBaseEntry

        void mapResourceNameToCodeBaseEntry​(java.lang.String resourceName,
                                            ICodeBaseEntry codeBaseEntry)
        Add a resource name to codebase entry mapping. Once this is done, future lookups of this resource will automatically resolve to the given codebase entry.
        Parameters:
        resourceName - the resource name to map
        codeBaseEntry - the codebase entry to use for this resource
      • getApplicationCodebaseEntries

        java.util.Map<java.lang.String,​ICodeBaseEntry> getApplicationCodebaseEntries()
        Returns all of the application code base entries that are part of this class path.
        Returns:
        map where the key is slashed (VM) class name with ".class" suffix
      • close

        void close()
        Close all of the code bases that are part of this class path. This should be done once the client is finished with the classpath.
        Specified by:
        close in interface java.lang.AutoCloseable