|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMLSerializable
XML Serialization
Description:
Allows object xml serialization. To make an object implementing this interface persistent, it is enought to simply callwriteXML()
with
a valid XMLStreamWriter
. To load an object again it suffices to
create an empty object of this type and call readXML()
.read()
method, such that one can only construct
vaild objects.java.lang.StackOverflowError
.
Method Summary | |
---|---|
void |
readXML(javax.xml.stream.XMLStreamReader parser)
Reads the xml representation of an object form the xml input stream. |
void |
writeXML(javax.xml.stream.XMLStreamWriter writer)
Writes the xml representation of this object to the xml ouput stream. |
Method Detail |
---|
void writeXML(javax.xml.stream.XMLStreamWriter writer) throws java.io.IOException, javax.xml.stream.XMLStreamException
writeXML()
method
results in one xml element in the output stream.
writer
- XMLStreamWriter the xml output stream
java.io.IOException
- raised, if there are any io troubles
javax.xml.stream.XMLStreamException
- raised, if there are any parsing errorsvoid readXML(javax.xml.stream.XMLStreamReader parser) throws java.io.IOException, javax.xml.stream.XMLStreamException
readXML()
starts parsing by
checking the start tag of this object and finishes parsing by checking the
end tag. The caller has to ensure, that at method entry the current token
is the start tag. After the method call it's the callers responsibility to
move from the end tag to the next token.
parser
- XMLStreamReader the xml input stream
java.io.IOException
- raised, if there are any io troubles
javax.xml.stream.XMLStreamException
- raised, if there are any parsing errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |