|
ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.shrinkwrap.impl.base.ArchiveBase<T>
public abstract class ArchiveBase<T extends Archive<T>>
ArchiveBase
Base implementation of Archive
. Contains
support for operations (typically overloaded) that are
not specific to any particular storage implementation,
and may be delegated to other forms.
Constructor Summary | |
---|---|
protected |
ArchiveBase(String name,
Configuration configuration)
Constructor Creates a new Archive with the specified name |
Method Summary | ||
---|---|---|
T |
add(Archive<?> archive,
ArchivePath path,
Class<? extends StreamExporter> exporter)
Add an archive under a specific context and maintain the archive name as context path. |
|
T |
add(Asset asset,
ArchivePath path,
String name)
Adds the specified asset under the specified target (directory) using the specified name. |
|
T |
add(Asset asset,
String target)
Adds the specified resource under the context denoted by the specified target |
|
T |
add(Asset asset,
String target,
String name)
Adds the specified asset under the specified target (directory) using the specified name. |
|
T |
add(NamedAsset namedAsset)
Adds the asset encapsulated within the specified NamedAsset under the
encapsulated name and target (directory) |
|
T |
addAsDirectories(ArchivePath... paths)
Adds the specified directories. |
|
T |
addAsDirectories(String... paths)
Adds the specified directories. |
|
T |
addAsDirectory(String path)
Adds the specified directory. |
|
|
as(Class<TYPE> clazz)
Wraps an Archive in a different 'view'. |
|
protected T |
covariantReturn()
Provides typesafe covariant return of this instance |
|
boolean |
equals(Object obj)
|
|
Node |
get(String path)
Obtains the Node located at the specified path |
|
protected abstract Class<T> |
getActualClass()
Returns the actual typed class for this instance, used in safe casting for covariant return types |
|
ArchiveFormat |
getArchiveFormat()
|
|
|
getAsType(Class<X> type,
ArchivePath path)
Get a nested Archive as a specific type.The found Archives must have been added as a Archive, no import is performed. |
|
|
getAsType(Class<X> type,
ArchivePath path,
ArchiveFormat archiveFormat)
Get a nested Archive located in a ArchivePath as a specific type using the specify ArchiveFormat |
|
|
getAsType(Class<X> type,
Filter<ArchivePath> filter)
Get all nested Archive matching the filter as a specific type.The found Archives must have been added as a Archive, no import is performed. |
|
|
getAsType(Class<X> type,
Filter<ArchivePath> filter,
ArchiveFormat archiveFormat)
Get all nested Archive matching the filter as a specific type using the specify ArchiveFormat . |
|
|
getAsType(Class<X> type,
String path)
Get a nested Archive as a specific type.The found Archives must have been added as a Archive, no import is performed. |
|
|
getAsType(Class<X> type,
String path,
ArchiveFormat archiveFormat)
Get a nested Archive as a specific type using the specify ArchiveFormat |
|
Configuration |
getConfiguration()
Obtains the Configuration associated with this Archive |
|
String |
getName()
Obtains the name of this archive (ie. |
|
int |
hashCode()
|
|
T |
merge(Archive<?> source)
Merge the contents from an existing archive without maintaining the archive name in the context path. |
|
T |
merge(Archive<?> source,
ArchivePath path)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. |
|
T |
merge(Archive<?> source,
ArchivePath path,
Filter<ArchivePath> filter)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. |
|
T |
merge(Archive<?> source,
Filter<ArchivePath> filter)
Merge the contents from an existing archive without maintaining the archive name in the context path. |
|
T |
merge(Archive<?> source,
String path)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. |
|
T |
merge(Archive<?> source,
String path,
Filter<ArchivePath> filter)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. |
|
String |
toString()
Acts as a shorthand for Archive.toString(Formatter)
where the Formatters.SIMPLE is leveraged. |
|
String |
toString(boolean verbose)
If "true" is specified, acts as a shorthand for Archive.toString(Formatter)
where the Formatters.VERBOSE is leveraged. |
|
String |
toString(Formatter formatter)
Returns a view of this Archive as returned from the
specified Formatter . |
|
void |
writeTo(OutputStream outputStream,
Formatter formatter)
Prints the content of this Archive to the specified
OutputStream on the format defined by the specified
Formatter . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.shrinkwrap.api.Archive |
---|
add, add, addAsDirectory, contains, contains, delete, delete, get, getContent, getContent |
Constructor Detail |
---|
protected ArchiveBase(String name, Configuration configuration) throws IllegalArgumentException
name
- Name of the archiveconfiguration
- The configuration for this archive
IllegalArgumentException
- If the name was not specifiedMethod Detail |
---|
public ArchiveFormat getArchiveFormat()
getArchiveFormat
in interface ArchiveFormatAssociable
ArchiveFormatAssociable.getArchiveFormat()
public T add(Asset asset, String target) throws IllegalArgumentException
add
in interface Archive<T extends Archive<T>>
IllegalArgumentException
- If either the target or asset is not specifiedorg.jboss.shrinkwrap.api.Archive#add(java.lang.String, org.jboss.shrinkwrap.api.asset.Asset)
public T add(Asset asset, String target, String name) throws IllegalArgumentException
add
in interface Archive<T extends Archive<T>>
target
- The context directory under which to add the assetname
- The name to assign the assent under the target namespace
IllegalArgumentException
- If the target, name, or asset was not specifiedArchive.add(org.jboss.shrinkwrap.api.asset.Asset, java.lang.String, java.lang.String)
public T add(Asset asset, ArchivePath path, String name)
add
in interface Archive<T extends Archive<T>>
path
- The context directory under which to add the assetname
- The name to assign the assent under the target namespace
org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.ArchivePath, java.lang.String, org.jboss.shrinkwrap.api.asset.Asset)
public Node get(String path) throws IllegalArgumentException
Node
located at the specified path
get
in interface Archive<T extends Archive<T>>
Node
, or null if nothing is found at the Path
IllegalArgumentException
- If the path is not specifiedArchive.get(java.lang.String)
public <X extends Archive<X>> X getAsType(Class<X> type, String path)
Archive
as a specific type.
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the Archive
Archive.getAsType(java.lang.Class, java.lang.String)
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter)
Archive
matching the filter as a specific type.
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive asfilter
- Filter to match result
Collection
of found Archives matching given filter or empty Collection
if non found.Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.Filter)
public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path)
Archive
as a specific type.
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the Archive
ArchivePath
Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath)
public <X extends Archive<X>> X getAsType(Class<X> type, String path, ArchiveFormat archiveFormat)
Archive
as a specific type using the specify ArchiveFormat
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the Archive
Archive.getAsType(java.lang.Class, java.lang.String, org.jboss.shrinkwrap.api.ArchiveFormat)
public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path, ArchiveFormat archiveFormat)
Archive
located in a ArchivePath
as a specific type using the specify ArchiveFormat
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the Archive
ArchivePath
Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.ArchiveFormat)
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter, ArchiveFormat archiveFormat)
Archive
matching the filter as a specific type using the specify ArchiveFormat
.
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive asfilter
- Filter to match result
Collection
of found Archives matching given filter or empty Collection
if non found.Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.Filter, org.jboss.shrinkwrap.api.ArchiveFormat)
public T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> exporter)
add
in interface Archive<T extends Archive<T>>
archive
- to addpath
- to useexporter
- Exporter type to use in fulfilling the Asset.openStream()
contract for
the added (nested) archive.
Archive.add(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.ArchivePath, java.lang.Class)
public T add(NamedAsset namedAsset)
NamedAsset
under the
encapsulated name and target (directory)
add
in interface Archive<T extends Archive<T>>
org.jboss.shrinkwrap.api.Archive#add(NamedAsset))
public T addAsDirectory(String path) throws IllegalArgumentException
addAsDirectory
in interface Archive<T extends Archive<T>>
path
- The path to add
IllegalArgumentException
- If no path was specifiedArchive.addAsDirectory(java.lang.String)
public T addAsDirectories(ArchivePath... paths) throws IllegalArgumentException
addAsDirectories
in interface Archive<T extends Archive<T>>
paths
- The paths to add
IllegalArgumentException
- If no paths were specifiedArchive.addAsDirectories(org.jboss.shrinkwrap.api.ArchivePath[])
public T addAsDirectories(String... paths) throws IllegalArgumentException
addAsDirectories
in interface Archive<T extends Archive<T>>
paths
- The paths to add
IllegalArgumentException
- If no paths were specifiedArchive.addAsDirectories(java.lang.String[])
public final String getName()
getName
in interface Archive<T extends Archive<T>>
Archive.getName()
public T merge(Archive<?> source) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents from
IllegalArgumentException
- If the existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive)
public T merge(Archive<?> source, Filter<ArchivePath> filter) throws IllegalArgumentException
ArchivePath
s to include form the source Archive
.
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents from
IllegalArgumentException
- If the existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, ArchivePath path) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents to
IllegalArgumentException
- If the path or existing archive is not specifiedorg.jboss.shrinkwrap.api.Archive#merge(org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.Archive)
public T merge(Archive<?> source, String path, Filter<ArchivePath> filter) throws IllegalArgumentException
ArchivePath
s to include form the source Archive
.
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents tofilter
- Filter to use for including Asset
s in the merge.
IllegalArgumentException
- If the path or existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive, java.lang.String, org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, String path) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents to
IllegalArgumentException
- If the path or existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive, java.lang.String)
public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter) throws IllegalArgumentException
ArchivePath
s to include form the source Archive
.
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents tofilter
- Filter to use for including Asset
s in the merge.
IllegalArgumentException
- If the path or existing archive is not specifiedorg.jboss.shrinkwrap.api.Archive#merge(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Filter)
public <TYPE extends Assignable> TYPE as(Class<TYPE> clazz)
as
in interface Assignable
clazz
- Extension interface to load
Assignable.as(java.lang.Class)
public String toString()
Archive.toString(Formatter)
where the Formatters.SIMPLE
is leveraged.
toString
in interface Archive<T extends Archive<T>>
toString
in class Object
Archive.toString()
public String toString(boolean verbose)
Archive.toString(Formatter)
where the Formatters.VERBOSE
is leveraged. Otherwise the
Formatters.SIMPLE
will be used (equivalent to Archive.toString()
).
toString
in interface Archive<T extends Archive<T>>
Archive.toString(boolean)
public String toString(Formatter formatter) throws IllegalArgumentException
Archive
as returned from the
specified Formatter
. Common options may be to use
the predefined formatters located in Formatters
toString
in interface Archive<T extends Archive<T>>
IllegalArgumentException
- If the formatter is not specifiedArchive.toString(org.jboss.shrinkwrap.api.formatter.Formatter)
public void writeTo(OutputStream outputStream, Formatter formatter) throws IllegalArgumentException
Archive
to the specified
OutputStream
on the format defined by the specified
Formatter
. The caller is responsible for opening,
flushing and eventually closing the stream.
writeTo
in interface Archive<T extends Archive<T>>
outputStream
- the stream to print the archive contents toformatter
- the output format
IllegalArgumentException
- if an exceptions occur when
writing the archive contents.public int hashCode()
hashCode
in class Object
org.jboss.shrinkwrap.api.Archive#hashCode()
public boolean equals(Object obj)
equals
in class Object
org.jboss.shrinkwrap.api.Archive#equals(Object)
public Configuration getConfiguration()
Configuration
associated with this Archive
getConfiguration
in interface Configurable
Configurable.getConfiguration()
protected abstract Class<T> getActualClass()
protected final T covariantReturn()
|
ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |