org.apache.maven.model.building
Class DefaultModelProcessor

java.lang.Object
  extended by org.apache.maven.model.building.DefaultModelProcessor
All Implemented Interfaces:
ModelProcessor, ModelReader, ModelLocator

@Component(role=ModelProcessor.class)
public class DefaultModelProcessor
extends Object
implements ModelProcessor


Field Summary
 
Fields inherited from interface org.apache.maven.model.building.ModelProcessor
SOURCE
 
Fields inherited from interface org.apache.maven.model.io.ModelReader
INPUT_SOURCE, IS_STRICT
 
Constructor Summary
DefaultModelProcessor()
           
 
Method Summary
 File locatePom(File projectDirectory)
          Locates the POM file within the specified project directory.
 Model read(File input, Map<String,?> options)
          Reads the model from the specified file.
 Model read(InputStream input, Map<String,?> options)
          Reads the model from the specified byte stream.
 Model read(Reader input, Map<String,?> options)
          Reads the model from the specified character reader.
 DefaultModelProcessor setModelLocator(ModelLocator locator)
           
 DefaultModelProcessor setModelReader(ModelReader reader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModelProcessor

public DefaultModelProcessor()
Method Detail

setModelLocator

public DefaultModelProcessor setModelLocator(ModelLocator locator)

setModelReader

public DefaultModelProcessor setModelReader(ModelReader reader)

locatePom

public File locatePom(File projectDirectory)
Description copied from interface: ModelLocator
Locates the POM file within the specified project directory. In case the given project directory does not exist or does not contain a POM file, the return value indicates the expected path to the POM file. Sub directories of the project directory will not be considered when locating the POM file. The return value will be an absolute path if the project directory is given as an absolute path.

Specified by:
locatePom in interface ModelLocator
Parameters:
projectDirectory - The (possibly non-existent) base directory to locate the POM file in, must not be null.
Returns:
The path to the (possibly non-existent) POM file, never null.

read

public Model read(File input,
                  Map<String,?> options)
           throws IOException
Description copied from interface: ModelReader
Reads the model from the specified file.

Specified by:
read in interface ModelReader
Parameters:
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.
Returns:
The deserialized model, never null.
Throws:
IOException - If the model could not be deserialized.
ModelParseException - If the input format could not be parsed.

read

public Model read(Reader input,
                  Map<String,?> options)
           throws IOException
Description copied from interface: ModelReader
Reads the model from the specified character reader. The reader will be automatically closed before the method returns.

Specified by:
read in interface ModelReader
Parameters:
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.
Returns:
The deserialized model, never null.
Throws:
IOException - If the model could not be deserialized.
ModelParseException - If the input format could not be parsed.

read

public Model read(InputStream input,
                  Map<String,?> options)
           throws IOException
Description copied from interface: ModelReader
Reads the model from the specified byte stream. The stream will be automatically closed before the method returns.

Specified by:
read in interface ModelReader
Parameters:
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.
Returns:
The deserialized model, never null.
Throws:
IOException - If the model could not be deserialized.
ModelParseException - If the input format could not be parsed.


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.