@Named(value="core-default") @Singleton @Typed(value=ModelProcessor.class) public class DefaultModelProcessor extends java.lang.Object implements ModelProcessor
Modifier and Type | Field and Description |
---|---|
private ModelLocator |
locator |
private ModelReader |
reader |
SOURCE
INPUT_SOURCE, IS_STRICT
Constructor and Description |
---|
DefaultModelProcessor() |
Modifier and Type | Method and Description |
---|---|
java.io.File |
locatePom(java.io.File projectDirectory)
Locates the POM file within the specified project directory.
|
Model |
read(java.io.File input,
java.util.Map<java.lang.String,?> options)
Reads the model from the specified file.
|
Model |
read(java.io.InputStream input,
java.util.Map<java.lang.String,?> options)
Reads the model from the specified byte stream.
|
Model |
read(java.io.Reader input,
java.util.Map<java.lang.String,?> options)
Reads the model from the specified character reader.
|
DefaultModelProcessor |
setModelLocator(ModelLocator locator) |
DefaultModelProcessor |
setModelReader(ModelReader reader) |
@Inject private ModelLocator locator
@Inject private ModelReader reader
public DefaultModelProcessor setModelLocator(ModelLocator locator)
public DefaultModelProcessor setModelReader(ModelReader reader)
public java.io.File locatePom(java.io.File projectDirectory)
ModelLocator
locatePom
in interface ModelLocator
projectDirectory
- The (possibly non-existent) base directory to locate the POM file in, must not be null
.null
.public Model read(java.io.File input, java.util.Map<java.lang.String,?> options) throws java.io.IOException
ModelReader
read
in interface ModelReader
input
- The file to deserialize the model from, must not be null
.options
- The options to use for deserialization, may be null
to use the default values.null
.java.io.IOException
- If the model could not be deserialized.ModelParseException
- If the input format could not be parsed.public Model read(java.io.Reader input, java.util.Map<java.lang.String,?> options) throws java.io.IOException
ModelReader
read
in interface ModelReader
input
- The reader to deserialize the model from, must not be null
.options
- The options to use for deserialization, may be null
to use the default values.null
.java.io.IOException
- If the model could not be deserialized.ModelParseException
- If the input format could not be parsed.public Model read(java.io.InputStream input, java.util.Map<java.lang.String,?> options) throws java.io.IOException
ModelReader
read
in interface ModelReader
input
- The stream to deserialize the model from, must not be null
.options
- The options to use for deserialization, may be null
to use the default values.null
.java.io.IOException
- If the model could not be deserialized.ModelParseException
- If the input format could not be parsed.