Package org.glassfish.jersey.jettison
Interface JettisonMarshaller
-
- All Known Implementing Classes:
BaseJsonMarshaller,JettisonJaxbMarshaller
public interface JettisonMarshallerA JSON marshaller responsible for serializing Java content trees, defined by JAXB, to JSON data.- Author:
- Paul Sandoz, Jakub Podlesak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidmarshallToJSON(Object jaxbElement, OutputStream os)Marshall the content tree rooted atjaxbElementinto an output stream.voidmarshallToJSON(Object jaxbElement, Writer writer)Marshall the content tree rooted atjaxbElementinto an output stream.voidsetProperty(String name, Object value)Set the particular property in the underlying implementation ofJettisonMarshaller.
-
-
-
Field Detail
-
FORMATTED
static final String FORMATTED
- See Also:
- Constant Field Values
-
-
Method Detail
-
marshallToJSON
void marshallToJSON(Object jaxbElement, OutputStream os) throws jakarta.xml.bind.JAXBException
Marshall the content tree rooted atjaxbElementinto an output stream. The content tree may be an instance of a class that is mapped to a XML root element (for example, annotated withXmlRootElement) or an instance ofJAXBElement.The UTF-8 character encoding scheme will be used to encode the characters of the JSON data.
- Parameters:
jaxbElement- the root of the content tree to be marshalled.os- the JSON will be added to this stream.- Throws:
jakarta.xml.bind.JAXBException- if any unexpected problem occurs during the marshalling.jakarta.xml.bind.MarshalException- if theJsonMarshalleris unable to marshaljaxbElement(or any object reachable from obj)IllegalArgumentException- if any of the method parameters are null.
-
marshallToJSON
void marshallToJSON(Object jaxbElement, Writer writer) throws jakarta.xml.bind.JAXBException
Marshall the content tree rooted atjaxbElementinto an output stream. The content tree may be an instance of a class that is mapped to a XML root element (for example, annotated withXmlRootElement) or an instance ofJAXBElement.The character encoding scheme of the
writerwill be used to encode the characters of the JSON data.- Parameters:
jaxbElement- the root of the content tree to be marshalled.writer- the JSON will be added to this writer.- Throws:
jakarta.xml.bind.JAXBException- if any unexpected problem occurs during the marshalling.jakarta.xml.bind.MarshalException- if theJsonMarshalleris unable to marshaljaxbElement(or any object reachable from obj)IllegalArgumentException- If any of the method parameters are null.
-
setProperty
void setProperty(String name, Object value) throws jakarta.xml.bind.PropertyException
Set the particular property in the underlying implementation ofJettisonMarshaller. Attempting to set an undefined property will result in a PropertyException being thrown.- Parameters:
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 set- Throws:
jakarta.xml.bind.PropertyException- when there is an error processing the given property or valueIllegalArgumentException- If the name parameter is null
-
-