public class JSONObjectFormatter extends java.lang.Object implements ObjectFormatter<JSON>
dateFormat
Constructor and Description |
---|
JSONObjectFormatter() |
Modifier and Type | Method and Description |
---|---|
JSON |
encode(java.util.Collection<OpenJPAStateManager> sms,
javax.persistence.metamodel.Metamodel model)
Encode the
persistent closure of the given collection of managed instances as a
resource e.g a XML or HTML document or an interactive document with JavaScript or a JSON array. |
JSON |
encode(javax.persistence.metamodel.Metamodel model)
Encode the given domain model in to a object.
|
void |
encode(java.lang.Object obj,
JPAServletContext ctx) |
java.lang.String |
getMimeType()
Gets the mime type produced by this formatter.
|
(package private) java.lang.String |
streamToString(java.lang.Object value)
Convert the given stream (either an InutStream or a Reader) to a String
to be included in CDATA section of a XML document.
|
(package private) java.lang.String |
typeOf(OpenJPAStateManager sm) |
JSON |
writeOut(java.util.Collection<OpenJPAStateManager> sms,
javax.persistence.metamodel.Metamodel model,
java.lang.String title,
java.lang.String desc,
java.lang.String uri,
java.io.OutputStream out)
Encodes the
persistent closure of the given collection of objects, then write it into
the given output stream. |
JSON |
writeOut(javax.persistence.metamodel.Metamodel model,
java.lang.String title,
java.lang.String desc,
java.lang.String uri,
java.io.OutputStream out)
Encodes the given domain model, then write it into the given output stream.
|
public java.lang.String getMimeType()
ObjectFormatter
getMimeType
in interface ObjectFormatter<JSON>
public void encode(java.lang.Object obj, JPAServletContext ctx)
public JSON writeOut(java.util.Collection<OpenJPAStateManager> sms, javax.persistence.metamodel.Metamodel model, java.lang.String title, java.lang.String desc, java.lang.String uri, java.io.OutputStream out) throws java.io.IOException
ObjectFormatter
persistent closure
of the given collection of objects, then write it into
the given output stream.writeOut
in interface ObjectFormatter<JSON>
sms
- the collection of objects to be formatted.model
- a meta-model of managed types, provided for easier introspection if necessarytitle
- TODOdesc
- TODOuri
- TODOjava.io.IOException
public JSON encode(java.util.Collection<OpenJPAStateManager> sms, javax.persistence.metamodel.Metamodel model)
ObjectFormatter
persistent closure
of the given collection of managed instances as a
resource e.g a XML or HTML document or an interactive document with JavaScript or a JSON array.
Exact nature of the output type is the generic parameter of this interface.encode
in interface ObjectFormatter<JSON>
sms
- a collection of managed instancesmodel
- domain modeljava.lang.String typeOf(OpenJPAStateManager sm)
java.lang.String streamToString(java.lang.Object value)
value
- the field value to be converted. Can not be nullpublic JSON encode(javax.persistence.metamodel.Metamodel model)
ObjectFormatter
encode
in interface ObjectFormatter<JSON>
model
- a meta-model of managed typespublic JSON writeOut(javax.persistence.metamodel.Metamodel model, java.lang.String title, java.lang.String desc, java.lang.String uri, java.io.OutputStream out) throws java.io.IOException
ObjectFormatter
writeOut
in interface ObjectFormatter<JSON>
model
- a meta-model of managed typesjava.io.IOException
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.