public class JSONObjectFormatter extends Object implements ObjectFormatter<JSON>
dateFormat
Constructor and Description |
---|
JSONObjectFormatter() |
Modifier and Type | Method and Description |
---|---|
JSON |
encode(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(Object obj,
JPAServletContext ctx) |
String |
getMimeType()
Gets the mime type produced by this formatter.
|
JSON |
writeOut(Collection<OpenJPAStateManager> sms,
javax.persistence.metamodel.Metamodel model,
String title,
String desc,
String uri,
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,
String title,
String desc,
String uri,
OutputStream out)
Encodes the given domain model, then write it into the given output stream.
|
public String getMimeType()
ObjectFormatter
getMimeType
in interface ObjectFormatter<JSON>
public void encode(Object obj, JPAServletContext ctx)
public JSON writeOut(Collection<OpenJPAStateManager> sms, javax.persistence.metamodel.Metamodel model, String title, String desc, String uri, OutputStream out) throws 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
- TODOIOException
public JSON encode(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 modelpublic 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, String title, String desc, String uri, OutputStream out) throws IOException
ObjectFormatter
writeOut
in interface ObjectFormatter<JSON>
model
- a meta-model of managed typesIOException
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.