Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.xml.bind.helpers.AbstractMarshallerImpl
javax.xml.bind.Marshaller.marshal(Object, javax.xml.transform.Result)
.
Marshaller
Fields inherited from interface javax.xml.bind.Marshaller | |
JAXB_ENCODING , JAXB_FORMATTED_OUTPUT , JAXB_NO_NAMESPACE_SCHEMA_LOCATION , JAXB_SCHEMA_LOCATION |
Constructor Summary | |
|
Method Summary | |
protected String |
|
ValidationEventHandler | |
protected String |
|
protected String |
|
Node |
|
Object |
|
protected String |
|
protected boolean |
|
void |
|
void |
|
void |
|
void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
public AbstractMarshallerImpl()
Creates a new instance ofAbstractMarshallerImpl
.
protected String getEncoding()
Returns the current output encoding.
- Returns:
- The current encoding, by default "UTF-8".
- See Also:
Marshaller.JAXB_ENCODING
public ValidationEventHandler getEventHandler() throws JAXBException
- Specified by:
- getEventHandler in interface Marshaller
protected String getJavaEncoding(String pEncoding) throws UnsupportedEncodingException
Converts the given IANA encoding name into a Java encoding name. This is a helper method for derived subclasses.
protected String getNoNSSchemaLocation()
Returns the marshallers "no namespace" schema location. Defaults to null.
public Node getNode(Object obj) throws JAXBException
This method is unsupported in the default implementation and throws anUnsupportedOperationException
.
- Specified by:
- getNode in interface Marshaller
public Object getProperty(String pName) throws PropertyException
Public interface to get the properties defined by theMarshaller
interface. Works by invocation ofgetEncoding()
,isFormattedOutput()
,getNoNSSchemaLocation()
, andgetSchemaLocation()
internally. If you want to support additional properties, you have to override this method in a subclass.
- Specified by:
- getProperty in interface Marshaller
- Throws:
PropertyException
- Unknown property name
protected String getSchemaLocation()
Returns the marshallers schema location. Defaults to null.
- See Also:
Marshaller.JAXB_SCHEMA_LOCATION
protected boolean isFormattedOutput()
Returns whether the marshaller will create formatted output or not. By default it does.
- See Also:
Marshaller.JAXB_FORMATTED_OUTPUT
public final void marshal(Object pObject, ContentHandler pHandler) throws JAXBException
- Specified by:
- marshal in interface Marshaller
public final void marshal(Object pObject, Node pNode) throws JAXBException
- Specified by:
- marshal in interface Marshaller
public final void marshal(Object pObject, OutputStream pStream) throws JAXBException
- Specified by:
- marshal in interface Marshaller
public final void marshal(Object pObject, Writer pWriter) throws JAXBException
- Specified by:
- marshal in interface Marshaller
protected void setEncoding(String pEncoding)
Sets the current output encoding.
- See Also:
Marshaller.JAXB_ENCODING
public void setEventHandler(ValidationEventHandler pHandler) throws JAXBException
- Specified by:
- setEventHandler in interface Marshaller
protected void setFormattedOutput(boolean pFormattedOutput)
Sets whether the marshaller will create formatted output or not. By default it does.
- See Also:
Marshaller.JAXB_FORMATTED_OUTPUT
protected void setNoNSSchemaLocation(String pNoNSSchemaLocation)
Sets the marshallers "no namespace" schema location. Defaults to null.
public void setProperty(String pName, Object pValue) throws PropertyException
Public interface to set the properties defined by theMarshaller
interface. Works by invocation ofsetEncoding(String)
,setFormattedOutput(boolean)
,setNoNSSchemaLocation(String)
, andsetSchemaLocation(String)
internally. If you want to support additional properties, you have to override this method in a subclass.
- Specified by:
- setProperty in interface Marshaller
- Throws:
PropertyException
- Unknown property name
protected void setSchemaLocation(String pSchemaLocation)
Sets the marshallers schema location. Defaults to null.
- See Also:
Marshaller.JAXB_SCHEMA_LOCATION