| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public abstract class AbstractMarshallerImpl extends Object implements Marshaller
Partial default Marshaller implementation.
This class provides a partial default implementation for the {@link javax.xml.bind.Marshaller} interface.
The only methods that a JAXB Provider has to implement are {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.transform.Result)}, {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLStreamWriter)}, and {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.
Constructor Summary | |
---|---|
|
Method Summary | |
---|---|
XmlAdapter |
getAdapter(Class type) |
AttachmentMarshaller |
|
protected String |
Convenience method for getting the current output encoding. |
ValidationEventHandler |
|
protected String |
getJavaEncoding(String encoding) Gets the corresponding Java encoding name from an IANA name. |
Marshaller.Listener |
|
Node |
By default, the getNode method is unsupported and throw an java.lang.UnsupportedOperationException. |
protected String |
Convenience method for getting the current noNamespaceSchemaLocation. |
Object |
getProperty(String name) Default implementation of the getProperty method handles the four defined properties in Marshaller. |
Schema |
|
protected String |
Convenience method for getting the current schemaLocation. |
protected boolean |
Convenience method for getting the formatted output flag. |
protected boolean |
Convenience method for getting the fragment flag. |
void |
marshal(Object obj, ContentHandler handler) |
void |
|
void |
|
void |
marshal(Object obj, OutputStream os) |
void |
|
void |
marshal(Object obj, XMLEventWriter writer) |
void |
marshal(Object obj, XMLStreamWriter writer) |
void |
setAdapter(Class type, XmlAdapter adapter) |
void |
setAdapter(XmlAdapter adapter) |
void |
|
protected void |
setEncoding(String encoding) Convenience method for setting the output encoding. |
void |
setEventHandler(ValidationEventHandler handler) |
protected void |
setFormattedOutput(boolean v) Convenience method for setting the formatted output flag. |
protected void |
setFragment(boolean v) Convenience method for setting the fragment flag. |
void |
setListener(Marshaller.Listener listener) |
protected void |
setNoNSSchemaLocation(String location) Convenience method for setting the noNamespaceSchemaLocation. |
void |
setProperty(String name, Object value) Default implementation of the setProperty method handles the four defined properties in Marshaller. |
void |
|
protected void |
setSchemaLocation(String location) Convenience method for setting the schemaLocation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMarshallerImpl()
Method Detail |
---|
public XmlAdapter getAdapter(Class type)
type
public AttachmentMarshaller getAttachmentMarshaller()
protected String getEncoding()
public ValidationEventHandler getEventHandler() throws JAXBException
JAXBException
protected String getJavaEncoding(String encoding) throws UnsupportedEncodingException
encoding
UnsupportedEncodingException
- If this implementation couldn't find the Java encoding name.public Marshaller.Listener getListener()
public Node getNode(Object obj) throws JAXBException
obj
JAXBException
protected String getNoNSSchemaLocation()
public Object getProperty(String name) throws PropertyException
name
PropertyException
public Schema getSchema()
protected String getSchemaLocation()
protected boolean isFormattedOutput()
protected boolean isFragment()
public final void marshal(Object obj, ContentHandler handler) throws JAXBException
obj
handler
JAXBException
public void marshal(Object jaxbElement, File output) throws JAXBException
jaxbElement
output
JAXBException
public final void marshal(Object obj, Node node) throws JAXBException
obj
node
JAXBException
public final void marshal(Object obj, OutputStream os) throws JAXBException
obj
os
JAXBException
public final void marshal(Object obj, Writer w) throws JAXBException
obj
w
JAXBException
public void marshal(Object obj, XMLEventWriter writer) throws JAXBException
obj
writer
JAXBException
public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException
obj
writer
JAXBException
public void setAdapter(Class type, XmlAdapter adapter)
type
adapter
public void setAdapter(XmlAdapter adapter)
adapter
public void setAttachmentMarshaller(AttachmentMarshaller am)
am
protected void setEncoding(String encoding)
encoding
- a valid encoding as specified in the Marshaller class
documentationpublic void setEventHandler(ValidationEventHandler handler) throws JAXBException
handler
JAXBException
protected void setFormattedOutput(boolean v)
v
- value of the formatted output flag.protected void setFragment(boolean v)
v
- value of the fragment flag.public void setListener(Marshaller.Listener listener)
listener
protected void setNoNSSchemaLocation(String location)
location
- the noNamespaceSchemaLocation valuepublic void setProperty(String name, Object value) throws PropertyException
name
value
PropertyException
public void setSchema(Schema schema)
schema
protected void setSchemaLocation(String location)
location
- the schemaLocation value
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |