Class LocationAwareMavenReader
- java.lang.Object
-
- org.technologybrewery.baton.util.pom.LocationAwareMavenReader
-
public final class LocationAwareMavenReader extends Object
This class is nearly an exact copy ofMavenXpp3ReaderEx(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 Modifier and Type Class Description static interfaceLocationAwareMavenReader.ContentTransformer
-
Field Summary
Fields Modifier and Type Field Description LocationAwareMavenReader.ContentTransformercontentTransformerField contentTransformer.static StringENDstatic StringSTART
-
Constructor Summary
Constructors Constructor Description LocationAwareMavenReader()LocationAwareMavenReader(LocationAwareMavenReader.ContentTransformer contentTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetAddDefaultEntities()Returns 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.Modelread(Reader reader, boolean strict, org.apache.maven.model.InputSource source)voidsetAddDefaultEntities(boolean addDefaultEntities)Sets the state of the "add default entities" flag.
-
-
-
Field Detail
-
contentTransformer
public final LocationAwareMavenReader.ContentTransformer contentTransformer
Field contentTransformer.
-
START
public static final String START
-
END
public static final String END
-
-
Constructor Detail
-
LocationAwareMavenReader
public LocationAwareMavenReader()
-
LocationAwareMavenReader
public LocationAwareMavenReader(LocationAwareMavenReader.ContentTransformer contentTransformer)
-
-
Method Detail
-
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-
-
-