javax.xml.bind.helpers
public abstract class AbstractMarshallerImpl extends Object implements Marshaller
Default implementation of a Marshaller. The JAXB provider needs to implement only {@link javax.xml.bind.Marshaller#marshal(Object, javax.xml.transform.Result)}.
Since: JAXB1.0
See Also: Marshaller
Constructor Summary | |
---|---|
AbstractMarshallerImpl() Creates a new instance of |
Method Summary | |
---|---|
protected String | getEncoding() Returns the current output encoding. |
ValidationEventHandler | getEventHandler() |
protected String | getJavaEncoding(String pEncoding) Converts the given IANA encoding name into a Java encoding name. |
Node | getNode(Object obj) This method is unsupported in the default implementation and throws an {@link UnsupportedOperationException}. |
protected String | getNoNSSchemaLocation() Returns the marshallers "no namespace" schema location. |
Object | getProperty(String pName) Public interface to get the properties defined by the {@link javax.xml.bind.Marshaller} interface. |
protected String | getSchemaLocation() Returns the marshallers schema location. |
protected boolean | isFormattedOutput() Returns whether the marshaller will create formatted output or not. |
void | marshal(Object pObject, OutputStream pStream) |
void | marshal(Object pObject, Writer pWriter) |
void | marshal(Object pObject, ContentHandler pHandler) |
void | marshal(Object pObject, Node pNode) |
protected void | setEncoding(String pEncoding) Sets the current output encoding. |
void | setEventHandler(ValidationEventHandler pHandler) |
protected void | setFormattedOutput(boolean pFormattedOutput) Sets whether the marshaller will create formatted output or not. |
protected void | setNoNSSchemaLocation(String pNoNSSchemaLocation) Sets the marshallers "no namespace" schema location. |
void | setProperty(String pName, Object pValue) Public interface to set the properties defined by the {@link javax.xml.bind.Marshaller} interface. |
protected void | setSchemaLocation(String pSchemaLocation) Sets the marshallers schema location. |
Creates a new instance of AbstractMarshallerImpl
.
Returns the current output encoding.
Returns: The current encoding, by default "UTF-8".
See Also: JAXB_ENCODING
Converts the given IANA encoding name into a Java encoding name. This is a helper method for derived subclasses.
This method is unsupported in the default implementation and throws an {@link UnsupportedOperationException}.
Throws: UnsupportedOperationException This method is not available in the default implementation.
Returns the marshallers "no namespace" schema location. Defaults to null.
See Also: JAXB_NO_NAMESPACE_SCHEMA_LOCATION
Public interface to get the properties defined by the {@link javax.xml.bind.Marshaller} interface. Works by invocation of {@link #getEncoding()}, {@link #isFormattedOutput()}, {@link #getNoNSSchemaLocation()}, and {@link #getSchemaLocation()} internally.
If you want to support additional properties, you have to override this method in a subclass.
Throws: PropertyException Unknown property name
Returns the marshallers schema location. Defaults to null.
See Also: JAXB_SCHEMA_LOCATION
Returns whether the marshaller will create formatted output or not. By default it does.
See Also: JAXB_FORMATTED_OUTPUT
Sets the current output encoding.
See Also: JAXB_ENCODING
Sets whether the marshaller will create formatted output or not. By default it does.
See Also: JAXB_FORMATTED_OUTPUT
Sets the marshallers "no namespace" schema location. Defaults to null.
See Also: JAXB_NO_NAMESPACE_SCHEMA_LOCATION
Public interface to set the properties defined by the {@link javax.xml.bind.Marshaller} interface. Works by invocation of {@link #setEncoding(String)}, {@link #setFormattedOutput(boolean)}, {@link #setNoNSSchemaLocation(String)}, and {@link #setSchemaLocation(String)} internally.
If you want to support additional properties, you have to override this method in a subclass.
Throws: PropertyException Unknown property name
Sets the marshallers schema location. Defaults to null.
See Also: JAXB_SCHEMA_LOCATION