Interface ClassContainer<T extends Archive<T>>
- All Superinterfaces:
ResourceContainer<T>
- All Known Subinterfaces:
JavaArchive, ServiceProviderContainer<T>, WebArchive
- All Known Implementing Classes:
ContainerBase, EnterpriseArchiveImpl, EnterpriseContainerBase, GenericArchiveImpl, JavaArchiveImpl, ResourceAdapterArchiveImpl, ResourceAdapterContainerBase, WebArchiveImpl, WebContainerBase
-
Method Summary
Modifier and TypeMethodDescriptionAdds theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, to theArchive.addClass(String fullyQualifiedClassName, ClassLoader cl) Adds theClass, and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by the specifiedClassLoader, to theArchive.addClasses(Class<?>... classes) addPackage(Package pack) addPackage(String pack) addPackages(boolean recursive, Package... packages) addPackages(boolean recursive, String... packages) addPackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) addPackages(boolean recursive, Filter<ArchivePath> filter, String... packages) deleteClass(Class<?> clazz) deleteClass(String fullyQualifiedClassName) Deletes theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, from theArchive.deleteClasses(Class<?>... classes) deletePackage(Package pack) deletePackage(String pack) deletePackages(boolean recursive, Package... packages) deletePackages(boolean recursive, String... packages) deletePackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) deletePackages(boolean recursive, Filter<ArchivePath> filter, String... packages) Methods inherited from interface ResourceContainer
addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResources
-
Method Details
-
addClass
- Parameters:
class- The class to add to the Archive- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class were specified
-
addClass
Adds theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, to theArchive.- Parameters:
fullyQualifiedClassName- The name of theClassto add- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class name was specifiedIllegalArgumentException- If theClasscould not be loaded
-
addClass
Adds theClass, and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by the specifiedClassLoader, to theArchive.- Parameters:
fullyQualifiedClassName- The name of theClassto addcl- TheClassLoaderused to load the Class- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class name was specifiedIllegalArgumentException- If noClassLoaderwas specifiedIllegalArgumentException- If theClasscould not be loaded by the targetClassLoader
-
addClasses
- Parameters:
classes- The classes to add to the Archive- Returns:
- This archive
- Throws:
IllegalArgumentException- If no classes were specified
-
addPackage
- Parameters:
pack- ThePackageto add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no package were specified- See Also:
-
addDefaultPackage
-
addPackages
- Parameters:
recursive- Should the sub packages be addedpackages- All the packages to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
addPackages
T addPackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) throws IllegalArgumentException Adds all classes accepted by the filter in the specifiedPackages to theArchive.
TheArchivePathreturned to the filter is theArchivePathof 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 addedfilter- filter out specific classespackages- All the packages to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified
-
addPackage
- Parameters:
pack- Package to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no package were specified- See Also:
-
addPackages
- Parameters:
recursive- Should the sub packages be addedpackages- All the packages to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
addPackages
T addPackages(boolean recursive, Filter<ArchivePath> filter, String... packages) throws IllegalArgumentException Adds all classes accepted by the filter in the specifiedPackages to theArchive.
TheArchivePathreturned to the filter is theArchivePathof 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 addedfilter- filter out specific classespackages- All the packages to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified
-
deleteClass
- Parameters:
class- The class to be deleted from the Archive- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class was specified
-
deleteClass
Deletes theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, from theArchive.- Parameters:
fullyQualifiedClassName- The name of theClassto be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class name was specifiedIllegalArgumentException- If theClasscould not be loaded
-
deleteClasses
- Parameters:
classes- The classes to be removed from theArchive- Returns:
- This archive
- Throws:
IllegalArgumentException- If no classes were specified
-
deletePackage
- Parameters:
pack- ThePackageto be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no package was specified- See Also:
-
deletePackage
- Parameters:
pack- Package to be delete represented by a String ("my/package")- Returns:
- This archive
- Throws:
IllegalArgumentException- If no package was specified- See Also:
-
deleteDefaultPackage
-
deletePackages
- Parameters:
recursive- Should the sub packages be deleted?packages- All the packages to be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
deletePackages
- 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:
IllegalArgumentException- If no packages were specified- See Also:
-
deletePackages
T deletePackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) throws IllegalArgumentException Deletes all classes accepted by the filter in the specifiedPackages from theArchive.
TheArchivePathreturned to the filter is theArchivePathof 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 classespackages- All the packages to be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified or if no filter was specified
-
deletePackages
T deletePackages(boolean recursive, Filter<ArchivePath> filter, String... packages) throws IllegalArgumentException Delete all classes accepted by the filter in the specifiedPackages from theArchive.
TheArchivePathreturned to the filter is theArchivePathof 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 classespackages- All the packages to be deleted represented by a String ("my/package")- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified or if no filter was specified
-