|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.marshaller.SAXMarshaller
public class SAXMarshaller
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.
Constructor Summary | |
---|---|
SAXMarshaller(org.xml.sax.ContentHandler _writer,
MarshallerImpl _owner)
Deprecated. Creates a marshalling context by designating the ContentHandler that receives generated SAX2 events. |
Method Summary | |
---|---|
void |
childAsAttributeBodies(XMLSerializable o)
Deprecated. This method is called when an XMLSerializable object is found while the marshaller is in the "attribute body" mode (i.e. |
void |
childAsAttributes(XMLSerializable o)
Deprecated. This method is called when an XMLSerializable object is found while the marshaller is in the "attribute" mode (i.e. |
void |
childAsElements(XMLSerializable o)
Deprecated. This method is called when an XMLSerializable object is found while the marshaller is in the "element" mode (i.e. |
void |
endAttribute()
Deprecated. |
void |
endAttributes()
Deprecated. Switches to the "marshal child texts/elements" mode. |
void |
endElement()
Deprecated. Ends marshalling of an element. |
NamespaceContext2 |
getNamespaceContext()
Deprecated. Obtains a namespace context object, which is used to declare/obtain namespace bindings. |
java.lang.String |
onID(java.lang.String value)
Deprecated. Notifies the serializer that an ID value has just marshalled. |
java.lang.String |
onIDREF(java.lang.String value)
Deprecated. Notifies the serializer that an IDREF value has just marshalled. |
void |
reportError(javax.xml.bind.ValidationEvent ve)
Deprecated. Errors detected by the XMLSerializable should be either thrown as SAXException or reported through this method. |
void |
startAttribute(java.lang.String uri,
java.lang.String local)
Deprecated. Starts marshalling of an attribute. |
void |
startElement(java.lang.String uri,
java.lang.String local)
Deprecated. Starts marshalling of an element. |
void |
text(java.lang.String text)
Deprecated. Marshalls text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SAXMarshaller(org.xml.sax.ContentHandler _writer, MarshallerImpl _owner)
Method Detail |
---|
public NamespaceContext2 getNamespaceContext()
XMLSerializer
getNamespaceContext
in interface XMLSerializer
public void startElement(java.lang.String uri, java.lang.String local) throws org.xml.sax.SAXException
startElement
in interface XMLSerializer
org.xml.sax.SAXException
public void endAttributes() throws org.xml.sax.SAXException
endAttributes
in interface XMLSerializer
org.xml.sax.SAXException
public void endElement() throws org.xml.sax.SAXException
endElement
in interface XMLSerializer
org.xml.sax.SAXException
public void text(java.lang.String text) throws org.xml.sax.SAXException
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>
.
text
in interface XMLSerializer
org.xml.sax.SAXException
public void startAttribute(java.lang.String uri, java.lang.String local)
startAttribute
in interface XMLSerializer
public void endAttribute()
endAttribute
in interface XMLSerializer
public java.lang.String onID(java.lang.String value) throws org.xml.sax.SAXException
XMLSerializer
onID
in interface XMLSerializer
org.xml.sax.SAXException
public java.lang.String onIDREF(java.lang.String value) throws org.xml.sax.SAXException
XMLSerializer
onIDREF
in interface XMLSerializer
org.xml.sax.SAXException
public void childAsElements(XMLSerializable o) throws org.xml.sax.SAXException
XMLSerializer
childAsElements
in interface XMLSerializer
org.xml.sax.SAXException
public void childAsAttributes(XMLSerializable o) throws org.xml.sax.SAXException
XMLSerializer
childAsAttributes
in interface XMLSerializer
org.xml.sax.SAXException
public void childAsAttributeBodies(XMLSerializable o) throws org.xml.sax.SAXException
XMLSerializer
childAsAttributeBodies
in interface XMLSerializer
org.xml.sax.SAXException
public void reportError(javax.xml.bind.ValidationEvent ve) throws AbortSerializationException
XMLSerializer
SAXException
or reported through this method.
The callee should report an error to the client application
and
reportError
in interface XMLSerializer
AbortSerializationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |