public interface JettisonMarshaller
Modifier and Type | Method and Description |
---|---|
void |
marshallToJSON(Object jaxbElement,
OutputStream os)
Marshall the content tree rooted at
jaxbElement into an
output stream. |
void |
marshallToJSON(Object jaxbElement,
Writer writer)
Marshall the content tree rooted at
jaxbElement into an
output stream. |
void |
setProperty(String name,
Object value)
Set the particular property in the underlying implementation of
JettisonMarshaller . |
static final String FORMATTED
void marshallToJSON(Object jaxbElement, OutputStream os) throws JAXBException
jaxbElement
into an
output stream. The content tree may be an instance of a class that is
mapped to a XML root element (for example, annotated with
XmlRootElement
) or an instance of JAXBElement
.
The UTF-8 character encoding scheme will be used to encode the characters of the JSON data.
jaxbElement
- the root of the content tree to be marshalled.os
- the JSON will be added to this stream.JAXBException
- if any unexpected problem occurs during the
marshalling.MarshalException
- if the JsonMarshaller
is unable to
marshal jaxbElement
(or any object reachable from obj)IllegalArgumentException
- if any of the method parameters are null.void marshallToJSON(Object jaxbElement, Writer writer) throws JAXBException
jaxbElement
into an
output stream. The content tree may be an instance of a class that is
mapped to a XML root element (for example, annotated with
XmlRootElement
) or an instance of JAXBElement
.
The character encoding scheme of the writer
will be used to
encode the characters of the JSON data.
jaxbElement
- the root of the content tree to be marshalled.writer
- the JSON will be added to this writer.JAXBException
- if any unexpected problem occurs during the
marshalling.MarshalException
- if the JsonMarshaller
is unable to
marshal jaxbElement
(or any object reachable from obj)IllegalArgumentException
- If any of the method parameters are null.void setProperty(String name, Object value) throws PropertyException
JettisonMarshaller
. Attempting to set an undefined property
will result in a PropertyException being thrown.name
- the name of the property to be set. This value can either
be specified using one of the constant fields or a user
supplied string.value
- the value of the property to be setPropertyException
- when there is an error processing the given
property or valueIllegalArgumentException
- If the name parameter is nullCopyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.