Class LocationAwareMavenReader
java.lang.Object
org.technologybrewery.baton.util.pom.LocationAwareMavenReader
This class is nearly an exact copy of
MavenXpp3ReaderEx (which tracks the
location of model elements in the original source POM). It extends the location tracking to attach the start and end
character of the entire block of XML for each element. This is useful for editing the file in place and preserving
the original formatting. In order to fully support this, some elements which previously did not have location
tracking have been updated to include it.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocationAwareMavenReader(LocationAwareMavenReader.ContentTransformer contentTransformer) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the state of the "add default entities" flag.org.apache.maven.model.Modelread(InputStream in, boolean strict, org.apache.maven.model.InputSource source) Method read.org.apache.maven.model.ModelvoidsetAddDefaultEntities(boolean addDefaultEntities) Sets the state of the "add default entities" flag.
-
Field Details
-
contentTransformer
Field contentTransformer. -
START
-
END
-
-
Constructor Details
-
LocationAwareMavenReader
public LocationAwareMavenReader() -
LocationAwareMavenReader
-
-
Method Details
-
getAddDefaultEntities
public boolean getAddDefaultEntities()Returns the state of the "add default entities" flag.- Returns:
- boolean
-
read
public org.apache.maven.model.Model read(Reader reader, boolean strict, org.apache.maven.model.InputSource source) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Parameters:
reader-source-strict-- Returns:
- Model
- Throws:
IOExceptionorg.codehaus.plexus.util.xml.pull.XmlPullParserException- See Also:
-
ReaderFactory.newXmlReader(java.io.InputStream)
-
read
public org.apache.maven.model.Model read(InputStream in, boolean strict, org.apache.maven.model.InputSource source) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException Method read.- Parameters:
in-source-strict-- Returns:
- Model
- Throws:
IOExceptionorg.codehaus.plexus.util.xml.pull.XmlPullParserException
-
setAddDefaultEntities
public void setAddDefaultEntities(boolean addDefaultEntities) Sets the state of the "add default entities" flag.- Parameters:
addDefaultEntities-
-