|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.media.json.internal.BaseJsonMarshaller
public class BaseJsonMarshaller
Base JSON marshaller implementation class.
| Field Summary | |
|---|---|
protected javax.xml.bind.Marshaller |
jaxbMarshaller
|
protected JsonConfiguration |
jsonConfig
|
| Fields inherited from interface org.glassfish.jersey.media.json.JsonMarshaller |
|---|
FORMATTED |
| Constructor Summary | |
|---|---|
BaseJsonMarshaller(javax.xml.bind.JAXBContext jaxbContext,
JsonConfiguration jsonConfig)
|
|
BaseJsonMarshaller(javax.xml.bind.Marshaller jaxbMarshaller,
JsonConfiguration jsonConfig)
|
|
| Method Summary | |
|---|---|
JsonConfiguration |
getJSONConfiguration()
Provides information on current JSON configuration options for this object. |
void |
marshallToJSON(java.lang.Object o,
java.io.OutputStream outputStream)
Marshall the content tree rooted at jaxbElement into an
output stream. |
void |
marshallToJSON(java.lang.Object o,
java.io.Writer writer)
Marshall the content tree rooted at jaxbElement into an
output stream. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Set the particular property in the underlying implementation of JsonMarshaller. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final javax.xml.bind.Marshaller jaxbMarshaller
protected JsonConfiguration jsonConfig
| Constructor Detail |
|---|
public BaseJsonMarshaller(javax.xml.bind.JAXBContext jaxbContext,
JsonConfiguration jsonConfig)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public BaseJsonMarshaller(javax.xml.bind.Marshaller jaxbMarshaller,
JsonConfiguration jsonConfig)
| Method Detail |
|---|
public JsonConfiguration getJSONConfiguration()
JsonConfigured
getJSONConfiguration in interface JsonConfiguredJsonConfiguration instance.
public void marshallToJSON(java.lang.Object o,
java.io.OutputStream outputStream)
throws javax.xml.bind.JAXBException
JsonMarshallerjaxbElement 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.
marshallToJSON in interface JsonMarshallero - the root of the content tree to be marshalled.outputStream - the JSON will be added to this stream.
javax.xml.bind.JAXBException - if any unexpected problem occurs during the
marshalling.
javax.xml.bind.MarshalException - if the JsonMarshaller is unable to
marshal jaxbElement (or any object reachable from obj)
public void marshallToJSON(java.lang.Object o,
java.io.Writer writer)
throws javax.xml.bind.JAXBException
JsonMarshallerjaxbElement 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.
marshallToJSON in interface JsonMarshallero - the root of the content tree to be marshalled.writer - the JSON will be added to this writer.
javax.xml.bind.JAXBException - if any unexpected problem occurs during the
marshalling.
javax.xml.bind.MarshalException - if the JsonMarshaller is unable to
marshal jaxbElement (or any object reachable from obj)
public void setProperty(java.lang.String key,
java.lang.Object value)
throws javax.xml.bind.PropertyException
JsonMarshallerJsonMarshaller. Attempting to set an undefined property
will result in a PropertyException being thrown.
setProperty in interface JsonMarshallerkey - 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
javax.xml.bind.PropertyException - when there is an error processing the given
property or value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||