Interface ClassContainer<T extends Archive<T>>

    • Method Detail

      • addClass

        T addClass​(java.lang.Class<?> clazz)
            throws java.lang.IllegalArgumentException
        Adds the Class, and all member (inner) Classes to the Archive.
        Parameters:
        class - The class to add to the Archive
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no class were specified
      • addClass

        T addClass​(java.lang.String fullyQualifiedClassName)
            throws java.lang.IllegalArgumentException
        Adds the Class, and all member (inner) Classes, with the specified fully-qualified name, loaded by the Thread Context ClassLoader, to the Archive.
        Parameters:
        fullyQualifiedClassName - The name of the Class to add
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no class name was specified
        java.lang.IllegalArgumentException - If the Class could not be loaded
      • addClass

        T addClass​(java.lang.String fullyQualifiedClassName,
                   java.lang.ClassLoader cl)
            throws java.lang.IllegalArgumentException
        Adds the Class, and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by the specified ClassLoader, to the Archive.
        Parameters:
        fullyQualifiedClassName - The name of the Class to add
        cl - The ClassLoader used to load the Class
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no class name was specified
        java.lang.IllegalArgumentException - If no ClassLoader was specified
        java.lang.IllegalArgumentException - If the Class could not be loaded by the target ClassLoader
      • addClasses

        T addClasses​(java.lang.Class<?>... classes)
              throws java.lang.IllegalArgumentException
        Adds the Classes, and all member (inner) Classes to the Archive.
        Parameters:
        classes - The classes to add to the Archive
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no classes were specified
      • addPackage

        T addPackage​(java.lang.Package pack)
              throws java.lang.IllegalArgumentException
        Adds all classes in the specified Package to the Archive.
        SubPackages are excluded.
        Parameters:
        pack - The Package to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - If no package were specified
        See Also:
        addPackages(boolean, Package...)
      • addDefaultPackage

        T addDefaultPackage()
        Adds all classes in the default Package to the Archive.
        SubPackages are excluded.
        Returns:
        This virtual archive
      • addPackages

        T addPackages​(boolean recursive,
                      java.lang.Package... packages)
               throws java.lang.IllegalArgumentException
        Adds all classes in the specified Packages to the Archive.
        Parameters:
        recursive - Should the sub packages be added
        packages - All the packages to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified
        See Also:
        addPackages(boolean, Filter, Package...)
      • addPackages

        T addPackages​(boolean recursive,
                      Filter<ArchivePath> filter,
                      java.lang.Package... packages)
               throws java.lang.IllegalArgumentException
        Adds all classes accepted by the filter in the specified Packages to the Archive.
        The ArchivePath returned to the filter is the ArchivePath of the class, not the final location.
        package.MyClass = /package/MyClass.class
        not: package.MyClass = /WEB-INF/classes/package/MyClass.class
        Parameters:
        recursive - Should the sub packages be added
        filter - filter out specific classes
        packages - All the packages to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified
      • addPackage

        T addPackage​(java.lang.String pack)
              throws java.lang.IllegalArgumentException
        Adds all classes in the specified Package to the Archive.
        SubPackages are excluded.
        Parameters:
        pack - Package to add represented by a String ("my/package")
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - If no package were specified
        See Also:
        addPackages(boolean, Package...)
      • addPackages

        T addPackages​(boolean recursive,
                      java.lang.String... packages)
               throws java.lang.IllegalArgumentException
        Adds all classes in the specified Packages to the Archive.
        Parameters:
        recursive - Should the sub packages be added
        packages - All the packages to add represented by a String ("my/package")
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified
        See Also:
        addPackages(boolean, Filter, Package...)
      • addPackages

        T addPackages​(boolean recursive,
                      Filter<ArchivePath> filter,
                      java.lang.String... packages)
               throws java.lang.IllegalArgumentException
        Adds all classes accepted by the filter in the specified Packages to the Archive.
        The ArchivePath returned to the filter is the ArchivePath of the class, not the final location.
        package.MyClass = /package/MyClass.class
        not: package.MyClass = /WEB-INF/classes/package/MyClass.class
        Parameters:
        recursive - Should the sub packages be added
        filter - filter out specific classes
        packages - All the packages to add represented by a String ("my/package")
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified
      • deleteClass

        T deleteClass​(java.lang.Class<?> clazz)
               throws java.lang.IllegalArgumentException
        Deletes the Class, and all member (inner) Classes from the Archive.
        Parameters:
        class - The class to be deleted from the Archive
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no class was specified
      • deleteClass

        T deleteClass​(java.lang.String fullyQualifiedClassName)
               throws java.lang.IllegalArgumentException
        Deletes the Class, and all member (inner) Classes, with the specified fully-qualified name, loaded by the Thread Context ClassLoader, from the Archive.
        Parameters:
        fullyQualifiedClassName - The name of the Class to be deleted
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no class name was specified
        java.lang.IllegalArgumentException - If the Class could not be loaded
      • deleteClasses

        T deleteClasses​(java.lang.Class<?>... classes)
                 throws java.lang.IllegalArgumentException
        Deletes the Classes, and all member (inner) Classes from the Archive.
        Parameters:
        classes - The classes to be removed from the Archive
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no classes were specified
      • deletePackage

        T deletePackage​(java.lang.Package pack)
                 throws java.lang.IllegalArgumentException
        Deletes all classes in the specified Package from the Archive.
        SubPackages are excluded.
        Parameters:
        pack - The Package to be deleted
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no package was specified
        See Also:
        deletePackages(boolean, Package...)
      • deletePackage

        T deletePackage​(java.lang.String pack)
                 throws java.lang.IllegalArgumentException
        Deletes all classes in the specified Package from the Archive.
        SubPackages are excluded.
        Parameters:
        pack - Package to be delete represented by a String ("my/package")
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no package was specified
        See Also:
        deletePackages(boolean, Package...)
      • deleteDefaultPackage

        T deleteDefaultPackage()
        Deletes all classes in the default Package from the Archive.
        SubPackages are excluded.
        Returns:
        This archive
      • deletePackages

        T deletePackages​(boolean recursive,
                         java.lang.Package... packages)
                  throws java.lang.IllegalArgumentException
        Deletes all classes in the specified Packages from the Archive.
        Parameters:
        recursive - Should the sub packages be deleted?
        packages - All the packages to be deleted
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified
        See Also:
        deletePackages(boolean, Filter, Package...)
      • deletePackages

        T deletePackages​(boolean recursive,
                         java.lang.String... packages)
                  throws java.lang.IllegalArgumentException
        Delete all classes in the specified Packages from the Archive.
        Parameters:
        recursive - Should the sub packages be deleted?
        packages - All the packages to be deleted represented by a String ("my/package")
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified
        See Also:
        deletePackages(boolean, Filter, Package...)
      • deletePackages

        T deletePackages​(boolean recursive,
                         Filter<ArchivePath> filter,
                         java.lang.Package... packages)
                  throws java.lang.IllegalArgumentException
        Deletes all classes accepted by the filter in the specified Packages from the Archive.
        The ArchivePath returned to the filter is the ArchivePath of the class, not the final location.
        package.MyClass = /package/MyClass.class
        not: package.MyClass = /WEB-INF/classes/package/MyClass.class
        Parameters:
        recursive - Should the sub packages be deleted?
        filter - filter out specific classes
        packages - All the packages to be deleted
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified or if no filter was specified
      • deletePackages

        T deletePackages​(boolean recursive,
                         Filter<ArchivePath> filter,
                         java.lang.String... packages)
                  throws java.lang.IllegalArgumentException
        Delete all classes accepted by the filter in the specified Packages from the Archive.
        The ArchivePath returned to the filter is the ArchivePath of the class, not the final location.
        package.MyClass = /package/MyClass.class
        not: package.MyClass = /WEB-INF/classes/package/MyClass.class
        Parameters:
        recursive - Should the sub packages be deleted?
        filter - filter out specific classes
        packages - All the packages to be deleted represented by a String ("my/package")
        Returns:
        This archive
        Throws:
        java.lang.IllegalArgumentException - If no packages were specified or if no filter was specified