Class ClassPathImpl

  • All Implemented Interfaces:
    IClassPath, java.lang.AutoCloseable

    public class ClassPathImpl
    extends java.lang.Object
    implements IClassPath
    Implementation of IClassPath.
    • Field Detail

      • auxCodeBaseList

        private final java.util.List<ICodeBase> auxCodeBaseList
      • codeBaseEntryMap

        private final java.util.Map<java.lang.String,​ICodeBaseEntry> codeBaseEntryMap
    • Constructor Detail

      • ClassPathImpl

        public ClassPathImpl()
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addCodeBase

        public void addCodeBase​(ICodeBase codeBase)
        Description copied from interface: IClassPath
        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.
        Specified by:
        addCodeBase in interface IClassPath
        Parameters:
        codeBase - the codebase to add
      • appCodeBaseIterator

        public java.util.Iterator<? extends ICodeBase> appCodeBaseIterator()
        Description copied from interface: IClassPath
        Return an iterator over the application codebases.
        Specified by:
        appCodeBaseIterator in interface IClassPath
        Returns:
        iterator over the application codebases
      • auxCodeBaseIterator

        public java.util.Iterator<? extends ICodeBase> auxCodeBaseIterator()
        Description copied from interface: IClassPath
        Return an iterator over the auxiliary codebases.
        Specified by:
        auxCodeBaseIterator in interface IClassPath
        Returns:
        iterator over the auxiliary codebases
      • close

        public void close()
        Description copied from interface: IClassPath
        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
        Specified by:
        close in interface IClassPath
      • getApplicationCodebaseEntries

        public java.util.Map<java.lang.String,​ICodeBaseEntry> getApplicationCodebaseEntries()
        Description copied from interface: IClassPath
        Returns all of the application code base entries that are part of this class path.
        Specified by:
        getApplicationCodebaseEntries in interface IClassPath
        Returns:
        map where the key is slashed (VM) class name with ".class" suffix
      • search

        private ICodeBaseEntry search​(java.util.List<? extends ICodeBase> codeBaseList,
                                      java.lang.String resourceName)
        Search list of codebases for named resource.
        Parameters:
        codeBaseList - list of codebases to search
        resourceName - name of resourse
        Returns:
        codebase entry for the named resource, or null if the named resource cannot be found
      • mapResourceNameToCodeBaseEntry

        public void mapResourceNameToCodeBaseEntry​(java.lang.String resourceName,
                                                   ICodeBaseEntry codeBaseEntry)
        Description copied from interface: IClassPath
        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.
        Specified by:
        mapResourceNameToCodeBaseEntry in interface IClassPath
        Parameters:
        resourceName - the resource name to map
        codeBaseEntry - the codebase entry to use for this resource