org.jboss.shrinkwrap.descriptor.api
Interface DescriptorImporter<T extends Descriptor>

Type Parameters:
T - The type of Descriptor supported by this importer

public interface DescriptorImporter<T extends Descriptor>

A type capable of importing a Descriptor from some existing source like a stream of bytes or File

Author:
ALR

Method Summary
 T from(File file)
          Deprecated. Use instead fromFile(File)
 T from(InputStream in)
          Deprecated. Use instead fromStream(InputStream)
 T from(InputStream in, boolean close)
          Deprecated. Use instead fromStream(InputStream, boolean)
 T from(String string)
          Deprecated. Use instead fromString(String)
 T fromFile(File file)
          Creates a new Descriptor from the given input file
 T fromFile(String file)
          Creates a new Descriptor from the given input file path
 T fromStream(InputStream in)
          Creates a new Descriptor from the given input stream, closing the specified stream when done, if applicable for the given input stream implementation.
 T fromStream(InputStream in, boolean close)
          Creates a new Descriptor from the given input
 T fromString(String string)
          Creates a new Descriptor from the given input XML data String
 

Method Detail

from

@Deprecated
T from(File file)
                          throws IllegalArgumentException,
                                 DescriptorImportException
Deprecated. Use instead fromFile(File)

Creates a new Descriptor from the given input file

Parameters:
file - the input file
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the file was not specified, does not exist, or is a directory
DescriptorImportException - If there was some error on import

fromFile

T fromFile(File file)
                              throws IllegalArgumentException,
                                     DescriptorImportException
Creates a new Descriptor from the given input file

Parameters:
file - the input file
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the file was not specified, does not exist, or is a directory
DescriptorImportException - If there was some error on import

fromFile

T fromFile(String file)
                              throws IllegalArgumentException,
                                     DescriptorImportException
Creates a new Descriptor from the given input file path

Parameters:
file - Path to the input file
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the file was not specified, does not exist, or is a directory
DescriptorImportException - If there was some error on import

from

@Deprecated
T from(InputStream in)
                          throws IllegalArgumentException,
                                 DescriptorImportException
Deprecated. Use instead fromStream(InputStream)

Creates a new Descriptor from the given input stream, closing the specified stream when done, if applicable for the given input stream implementation.

Parameters:
in - the InputStream
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the stream was not specified
DescriptorImportException - If there was some error on import

fromStream

T fromStream(InputStream in)
                                throws IllegalArgumentException,
                                       DescriptorImportException
Creates a new Descriptor from the given input stream, closing the specified stream when done, if applicable for the given input stream implementation.

Parameters:
in - the InputStream
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the stream was not specified
DescriptorImportException - If there was some error on import

from

@Deprecated
T from(InputStream in,
                  boolean close)
                          throws IllegalArgumentException,
                                 DescriptorImportException
Deprecated. Use instead fromStream(InputStream, boolean)

Creates a new Descriptor from the given input

Parameters:
in - the InputStream to use
close - whether to close the specified stream or not
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the stream was not specified
DescriptorImportException - If there was some error on import

fromStream

T fromStream(InputStream in,
             boolean close)
                                throws IllegalArgumentException,
                                       DescriptorImportException
Creates a new Descriptor from the given input

Parameters:
in - the InputStream to use
close - whether to close the specified stream or not
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the stream was not specified
DescriptorImportException - If there was some error on import

from

@Deprecated
T from(String string)
                          throws IllegalArgumentException,
                                 DescriptorImportException
Deprecated. Use instead fromString(String)

Creates a new Descriptor from the given input XML data String

Parameters:
string - the resource data
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the String was not specified
DescriptorImportException

fromString

T fromString(String string)
                                throws IllegalArgumentException,
                                       DescriptorImportException
Creates a new Descriptor from the given input XML data String

Parameters:
string - the resource URI
Returns:
the imported descriptor
Throws:
IllegalArgumentException - If the String was not specified
DescriptorImportException


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