|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader
public class ModifiedPomXMLEventReader
Represents the modified pom file. Note: implementations of the StAX API (JSR-173) are not good round-trip rewriting
while keeping all unchanged bytes in the file as is. For example, the StAX API specifies that CR
characters will be stripped. Current implementations do not keep " and ' characters consistent.
| Constructor Summary | |
|---|---|
ModifiedPomXMLEventReader(StringBuffer pom,
javax.xml.stream.XMLInputFactory factory)
Constructor ModifiedPomXMLEventReader creates a new ModifiedPomXMLEventReader instance. |
|
| Method Summary | |
|---|---|
StringBuffer |
asStringBuffer()
Returns a copy of the backing string buffer. |
void |
clearMark(int index)
Clears the mark. |
void |
close()
|
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()
|
javax.xml.stream.events.XMLEvent |
nextEvent()
|
javax.xml.stream.events.XMLEvent |
nextTag()
|
javax.xml.stream.events.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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModifiedPomXMLEventReader(StringBuffer pom,
javax.xml.stream.XMLInputFactory factory)
throws javax.xml.stream.XMLStreamException
pom - of type StringBufferfactory - of type XMLInputFactory
javax.xml.stream.XMLStreamException - when| Method Detail |
|---|
public void rewind()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException - when things go wrong.public boolean isModified()
public Object next()
next in interface Iteratorpublic void remove()
remove in interface Iterator
public javax.xml.stream.events.XMLEvent nextEvent()
throws javax.xml.stream.XMLStreamException
nextEvent in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException
public javax.xml.stream.events.XMLEvent peek()
throws javax.xml.stream.XMLStreamException
peek in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException
public String getElementText()
throws javax.xml.stream.XMLStreamException
getElementText in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException
public javax.xml.stream.events.XMLEvent nextTag()
throws javax.xml.stream.XMLStreamException
nextTag in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamExceptionpublic Object getProperty(String name)
getProperty in interface javax.xml.stream.XMLEventReader
public void close()
throws javax.xml.stream.XMLStreamException
close in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamExceptionpublic StringBuffer asStringBuffer()
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 javax.xml.stream.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 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||