ShrinkWrap Resolver API 2.0.0-cr-1

org.jboss.shrinkwrap.resolver.api
Interface FormatStage<RESOLVEDTYPE extends ResolvedArtifact<RESOLVEDTYPE>>

Type Parameters:
RESOLVEDTYPE -

public interface FormatStage<RESOLVEDTYPE extends ResolvedArtifact<RESOLVEDTYPE>>

Represents the formatting stage of resolution in which the RESOLVEDTYPE is returned in the desired format. Supports extensible formats by registering a FormatProcessor with the SPI.

Author:
Andrew Lee Rubinger, Karel Piwko

Method Summary
<RETURNTYPE>
RETURNTYPE[]
as(Class<RETURNTYPE> returnTypeClass)
          Formats the resultant artifacts as an array of types.
 File[] asFile()
          Formats the resultant artifacts as an array of Files
 InputStream[] asInputStream()
          Formats the resultant artifacts as an array of InputStreams.
 RESOLVEDTYPE[] asResolvedArtifact()
          Formats the resultant artifacts as an array of RESOLVEDTYPE.
<RETURNTYPE>
RETURNTYPE
asSingle(Class<RETURNTYPE> returnTypeClass)
          Formats the resultant artifact as a type; assumes a single artifact is returned from resolution.
 File asSingleFile()
          Formats the resultant artifact as a File; assumes a single artifact is returned from resolution.
 InputStream asSingleInputStream()
          Formats the resultant artifact as an InputStream; assumes a single artifact is returned from resolution.
 RESOLVEDTYPE asSingleResolvedArtifact()
          Formats the resultant artifact as RESOLVEDTYPE; assumes a single artifact is returned from resolution.
 

Method Detail

asFile

File[] asFile()
Formats the resultant artifacts as an array of Files

Returns:

asSingleFile

File asSingleFile()
                  throws NonUniqueResultException,
                         NoResolvedResultException
Formats the resultant artifact as a File; assumes a single artifact is returned from resolution.

Returns:
Throws:
NonUniqueResultException
NoResolvedResultException

asInputStream

InputStream[] asInputStream()
Formats the resultant artifacts as an array of InputStreams. It is a caller responsibility to close the streams afterwards.

Returns:

asSingleInputStream

InputStream asSingleInputStream()
                                throws NonUniqueResultException,
                                       NoResolvedResultException
Formats the resultant artifact as an InputStream; assumes a single artifact is returned from resolution. It is a caller responsibility to close the stream afterwards.

Returns:
Throws:
NonUniqueResultException
NoResolvedResultException

asResolvedArtifact

RESOLVEDTYPE[] asResolvedArtifact()
Formats the resultant artifacts as an array of RESOLVEDTYPE.

Returns:

asSingleResolvedArtifact

RESOLVEDTYPE asSingleResolvedArtifact()
                                                                             throws NonUniqueResultException,
                                                                                    NoResolvedResultException
Formats the resultant artifact as RESOLVEDTYPE; assumes a single artifact is returned from resolution.

Returns:
Throws:
NonUniqueResultException
NoResolvedResultException

as

<RETURNTYPE> RETURNTYPE[] as(Class<RETURNTYPE> returnTypeClass)
                throws IllegalArgumentException,
                       UnsupportedOperationException
Formats the resultant artifacts as an array of types. If nothing matches resolution, an empty array will be returned. Supports extensible formats by registering a FormatProcessor for given returnTypeClass.

Parameters:
returnTypeClass -
Returns:
Throws:
{@link - IllegalArgumentException} If the type is not specified
{@link - UnsupportedOperationException} If the type is not supported *
IllegalArgumentException
UnsupportedOperationException

asSingle

<RETURNTYPE> RETURNTYPE asSingle(Class<RETURNTYPE> returnTypeClass)
                    throws IllegalArgumentException,
                           UnsupportedOperationException,
                           NonUniqueResultException,
                           NoResolvedResultException
Formats the resultant artifact as a type; assumes a single artifact is returned from resolution. Supports extensible formats by registering a FormatProcessor for given returnTypeClass.

Parameters:
returnTypeClass -
Returns:
Throws:
NonUniqueResultException - If the resolution resulted in more than one result
NoResolvedResultException - If the resolution did not yield any result
{@link - IllegalArgumentException} If the type is not specified
{@link - UnsupportedOperationException} If the type is not supported
IllegalArgumentException
UnsupportedOperationException

ShrinkWrap Resolver API 2.0.0-cr-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.