|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.XMLBurger
public class XMLBurger
Library for efficient parsing of odd XML files. Particularly useful while dealing with odd XML document, where the mapping to Java Object is difficult.
Field Summary | |
---|---|
private int |
eventType
|
private java.io.FileInputStream |
fileInputStream
|
private org.codehaus.stax2.XMLStreamReader2 |
reader
|
Constructor Summary | |
---|---|
XMLBurger(java.lang.String pathOfXML)
Create an XMLBurger object from an XML file. |
Method Summary | |
---|---|
int |
getEventType()
|
java.io.FileInputStream |
getFileInputStream()
|
org.codehaus.stax2.XMLStreamReader2 |
getReader()
|
java.lang.String |
getTagAttribute(java.lang.String attribute)
Return the value associated with the current tag attribute. |
java.lang.String |
getTagText()
Return the text associated with the current tag. |
boolean |
inTag(java.lang.String tag)
Stay inside the tag passed as parameter. Usage: while(burger.inTag("NameOfYourTag")){ //Do something while staying inside the loop, usually looking for over tags via the tag() method. } |
boolean |
isNotOver()
Main loop, over the content of the entire XML. //Do things and check for tags } |
void |
setEventType(int eventType)
|
void |
setFileInputStream(java.io.FileInputStream fileInputStream)
|
void |
setReader(org.codehaus.stax2.XMLStreamReader2 reader)
|
boolean |
tag(java.lang.String tag)
Check if the tag passed as parameter is encountered. Usage: if(burger.tag("NameOfYourTag")){ //Do something, like instantiating of of your object or looping over the tag using the inTag("") method } |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.io.FileInputStream fileInputStream
private org.codehaus.stax2.XMLStreamReader2 reader
private int eventType
Constructor Detail |
---|
public XMLBurger(java.lang.String pathOfXML)
pathOfXML
- Method Detail |
---|
public void setEventType(int eventType)
public int getEventType()
public void setReader(org.codehaus.stax2.XMLStreamReader2 reader)
public org.codehaus.stax2.XMLStreamReader2 getReader()
public void setFileInputStream(java.io.FileInputStream fileInputStream)
public java.io.FileInputStream getFileInputStream()
public boolean isNotOver()
javax.xml.stream.XMLStreamException
public boolean tag(java.lang.String tag)
tag
-
public boolean inTag(java.lang.String tag)
tag
-
javax.xml.stream.XMLStreamException
public java.lang.String getTagText()
public java.lang.String getTagAttribute(java.lang.String attribute)
attribute
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |