public class ModifiedPomXMLEventReader extends Object implements XMLEventReader
CR
characters will be stripped. Current implementations do not keep " and ' characters consistent.| Constructor and Description |
|---|
ModifiedPomXMLEventReader(StringBuilder pom,
XMLInputFactory factory)
Constructor ModifiedPomXMLEventReader creates a new ModifiedPomXMLEventReader instance.
|
| Modifier and Type | Method and Description |
|---|---|
StringBuilder |
asStringBuilder()
Returns a copy of the backing string buffer.
|
void |
clearMark(int index)
Clears the mark.
|
void |
close() |
String |
getBetween(int index1,
int index2) |
String |
getElementText() |
String |
getMarkVerbatim(int index)
the verbatim text of the current element when
mark(int) was called. |
String |
getPeekVerbatim()
Returns the verbatim text of the element returned by
peek(). |
Object |
getProperty(String name) |
String |
getVerbatim()
Getter for property 'verbatim'.
|
boolean |
hasMark(int index)
Returns
true if the specified mark is defined. |
boolean |
hasNext() |
boolean |
isModified()
Getter for property 'modified'.
|
void |
mark(int index)
Sets a mark to the current event.
|
Object |
next() |
XMLEvent |
nextEvent() |
XMLEvent |
nextTag() |
org.apache.maven.model.Model |
parse() |
XMLEvent |
peek() |
void |
remove() |
void |
replace(String replacement)
Replaces the current element with the replacement text.
|
void |
replaceBetween(int index1,
int index2,
String replacement)
Replaces all content between marks index1 and index2 with the replacement text.
|
void |
replaceMark(int index,
String replacement)
Replaces the specified marked element with the replacement text.
|
void |
rewind()
Rewind to the start so we can run through again.
|
public ModifiedPomXMLEventReader(StringBuilder pom, XMLInputFactory factory) throws XMLStreamException
pom - of type StringBuilderfactory - of type XMLInputFactoryXMLStreamException - whenpublic void rewind()
throws XMLStreamException
XMLStreamException - when things go wrong.public boolean isModified()
public XMLEvent nextEvent() throws XMLStreamException
nextEvent in interface XMLEventReaderXMLStreamExceptionpublic XMLEvent peek() throws XMLStreamException
peek in interface XMLEventReaderXMLStreamExceptionpublic String getElementText() throws XMLStreamException
getElementText in interface XMLEventReaderXMLStreamExceptionpublic XMLEvent nextTag() throws XMLStreamException
nextTag in interface XMLEventReaderXMLStreamExceptionpublic Object getProperty(String name)
getProperty in interface XMLEventReaderpublic void close()
throws XMLStreamException
close in interface XMLEventReaderXMLStreamExceptionpublic StringBuilder asStringBuilder()
public void clearMark(int index)
index - the mark to clear.public String getMarkVerbatim(int index)
mark(int) was called.index - The mark index.mark(int) was called.public String getPeekVerbatim()
peek().peek().public boolean hasNext()
hasNext in interface IteratorhasNext in interface XMLEventReaderpublic String getVerbatim()
public void mark(int index)
index - the mark to set.public void replace(String replacement)
replacement - The replacement.public boolean hasMark(int index)
true if the specified mark is defined.index - The mark.true if the specified mark is defined.public String getBetween(int index1, int index2)
public void replaceBetween(int index1,
int index2,
String replacement)
index1 - The event mark to replace after.index2 - The event mark to replace before.replacement - The replacement.public void replaceMark(int index,
String replacement)
index - The mark.replacement - The replacement.public org.apache.maven.model.Model parse()
throws IOException,
org.codehaus.plexus.util.xml.pull.XmlPullParserException
IOExceptionorg.codehaus.plexus.util.xml.pull.XmlPullParserExceptionCopyright © 2008-2014. All Rights Reserved.