org.jboss.shrinkwrap.api.container
Interface ClassContainer<T extends Archive<T>>

All Known Subinterfaces:
JavaArchive, WebArchive

public interface ClassContainer<T extends Archive<T>>

ClassContainer Defines the contract for a component capable of storing Java Classes.

The actual path to the Class resources within the Archive is up to the implementations/specifications.

Version:
$Revision: $
Author:
Aslak Knutsen

Method Summary
 T addClass(Class<?> clazz)
          Adds the specified Class to the Archive.
 T addClasses(Class<?>... classes)
          Adds the specified Classes to the Archive.
 T addPackage(Package pack)
          Adds all classes in the specified Package to the Archive.
 T addPackages(boolean recursive, Package... packages)
          Adds all classes in the specified Packages to the Archive.
 

Method Detail

addClass

T addClass(Class<?> clazz)
                              throws IllegalArgumentException
Adds the specified Class to the Archive.

Parameters:
class - The class to add to the Archive
Returns:
This virtual archive
Throws:
IllegalArgumentException - If no class were specified

addClasses

T addClasses(Class<?>... classes)
                                throws IllegalArgumentException
Adds the specified Classes to the Archive.

Parameters:
classes - The classes to add to the Archive
Returns:
This virtual archive
Throws:
IllegalArgumentException - If no classes were specified

addPackage

T addPackage(Package pack)
                                throws IllegalArgumentException
Adds all classes in the specified Package to the Archive.

Parameters:
pack - The Package to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - If no package were specified

addPackages

T addPackages(boolean recursive,
              Package... packages)
                                 throws 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:
IllegalArgumentException - If no packages were specified


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.