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