| java.lang.Object com.mvnforum.jaxb.db.impl.runtime.SAXMarshaller
SAXMarshaller | public class SAXMarshaller implements XMLSerializer(Code) | | XMLSerializer that produces SAX2 events.
To marshal an object, create an instance of SAXMarshaller
and call the serializeElements method of the XMLSerializable
object that you want to marshal.
author: Kohsuke Kawaguchi |
Constructor Summary | |
public | SAXMarshaller(ContentHandler _writer, NamespacePrefixMapper prefixMapper, MarshallerImpl _owner) Creates a marshalling context by designating the ContentHandler
that receives generated SAX2 events. |
SAXMarshaller | public SAXMarshaller(ContentHandler _writer, NamespacePrefixMapper prefixMapper, MarshallerImpl _owner)(Code) | | Creates a marshalling context by designating the ContentHandler
that receives generated SAX2 events.
|
endAttribute | public void endAttribute()(Code) | | |
endAttributes | public void endAttributes() throws SAXException(Code) | | Switches to the "marshal child texts/elements" mode.
This method has to be called after the 1st pass is completed.
|
endElement | public void endElement() throws SAXException(Code) | | Ends marshalling of an element.
Pops the internal stack.
|
reconcileID | void reconcileID() throws AbortSerializationException(Code) | | |
startAttribute | public void startAttribute(String uri, String local)(Code) | | Starts marshalling of an attribute.
The marshalling of an attribute will be done by
- call the startAttribute method
- call the text method (several times if necessary)
- call the endAttribute method
No two attributes can be marshalled at the same time.
Note that the whole attribute marshalling must be happened
after the startElement method and before the endAttributes method.
|
startElement | public void startElement(String uri, String local) throws SAXException(Code) | | Starts marshalling of an element.
Calling this method will push the internal state into the
internal stack.
|
text | public void text(String text, String fieldName) throws SAXException(Code) | | Marshalls text.
This method can be called (i) after the startAttribute method
and (ii) before the endAttribute method, to marshal attribute values.
If the method is called more than once, those texts are considered
as separated by whitespaces. For example,
c.startAttribute();
c.text("abc");
c.text("def");
c.endAttribute("","foo");
will generate foo="abc def".
Similarly, this method can be called after the endAttributes
method to marshal texts inside elements. The same rule about
multiple invokations apply to this case, too. For example,
c.startElement("","foo");
c.endAttributes();
c.text("abc");
c.text("def");
c.startElement("","bar");
c.endAttributes();
c.endElement();
c.text("ghi");
c.endElement();
will generate <foo>abc def<bar/>ghi</foo> .
|
|
|