| java.lang.Object |
| ↳ |
org.odata4j.format.json.JsonFormatWriter<T> |
Known Direct Subclasses
|
Class Overview
Write content to an output stream in JSON format.
This class is abstract because it delegates the strategy pattern of writing
actual content elements to its (various) subclasses.
Each element in the array to be written can be wrapped in a function call
on the JavaScript side by specifying the name of a function to call to the
constructor.
Summary
| Public Methods |
|
String
|
getContentType()
Recover the MIME content type for the stream
|
|
void
|
write(UriInfo uriInfo, Writer w, T target)
Write an object to the formatted version of the stream
|
| Protected Methods |
|
String
|
getJsonpCallback()
|
|
ODataVersion
|
getVersion()
|
|
boolean
|
isV2OrGreater()
|
|
void
|
maybeWriteResultsProperty(JsonWriter jw)
|
|
void
|
writeCollection(JsonWriter jw, EdmCollectionType type, OCollection<? extends OObject> coll)
|
|
void
|
writeComplexObject(JsonWriter jw, String fullyQualifiedTypeName, List<OProperty<?>> props)
|
|
abstract
void
|
writeContent(UriInfo uriInfo, JsonWriter jw, T target)
A strategy method to actually write content objects
|
|
void
|
writeLinks(JsonWriter jw, OEntity oe, UriInfo uriInfo, boolean isResponse)
|
|
void
|
writeOEntity(UriInfo uriInfo, JsonWriter jw, OEntity oe, EdmEntitySet ees, boolean isResponse)
|
|
void
|
writeOProperties(JsonWriter jw, List<OProperty<?>> properties)
|
|
void
|
writeProperty(JsonWriter jw, OProperty<?> prop)
|
|
void
|
writeRequestLink(JsonWriter jw, OLink link, OEntity oe, UriInfo uriInfo)
|
|
void
|
writeResponseLink(JsonWriter jw, OLink link, OEntity oe, UriInfo uriInfo)
|
|
void
|
writeValue(JsonWriter jw, EdmType type, Object pvalue)
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
From interface
org.odata4j.format.FormatWriter
|
Fields
private
final
String
jsonpCallback
Public Constructors
public
JsonFormatWriter
(String jsonpCallback, ODataVersion version)
Creates a new JSON writer.
Parameters
| jsonpCallback
| A function to call on the javascript side to act
on the data provided in the content.
|
| version
| |
Public Methods
public
String
getContentType
()
Recover the MIME content type for the stream
Returns
- the MIME content type to be used for the content of this stream
public
void
write
(UriInfo uriInfo, Writer w, T target)
Write an object to the formatted version of the stream
Parameters
| uriInfo
| The base uri of the entity documents |
| w
| The underlying "stream" to write to |
| target
| The object to be written
|
Protected Methods
protected
String
getJsonpCallback
()
protected
boolean
isV2OrGreater
()
protected
void
maybeWriteResultsProperty
(JsonWriter jw)
protected
void
writeComplexObject
(JsonWriter jw, String fullyQualifiedTypeName, List<OProperty<?>> props)
Parameters
| jw
| |
| fullyQualifiedTypeName
| |
| props
| |
protected
abstract
void
writeContent
(UriInfo uriInfo, JsonWriter jw, T target)
A strategy method to actually write content objects
Parameters
| uriInfo
| The base URI that indicates where in the schema we are |
| jw
| The JSON writer object |
| target
| The content value to be written
|
protected
void
writeLinks
(JsonWriter jw, OEntity oe, UriInfo uriInfo, boolean isResponse)
protected
void
writeOEntity
(UriInfo uriInfo, JsonWriter jw, OEntity oe, EdmEntitySet ees, boolean isResponse)
Parameters
| uriInfo
| |
| jw
| |
| oe
| |
| ees
| |
| isResponse
| |