Detailed Description
JsonFormat realizes the JSON request/response format.
All data will be serialized using the json_encode method except for Nodes. Nodes are serialized into an array before encoding (see JsonFormat::serializeValue) using the NodeSerializer class. On serialization the data will be outputted directly using the print command.
JsonFormat collects the response data from all executed controllers into one response array and returns it all at once at the end of script execution. This prevents from having multiple junks of json from each controller response that can't be decoded by clients.
Definition at line 31 of file JsonFormat.php.
Public Member Functions | |
__construct (NodeSerializer $serializer) | |
getMimeType () | |
Public Member Functions inherited from AbstractFormat | |
deserialize (Request $request) | |
serialize (Response $response) | |
Static Public Member Functions | |
static | printJSONResult () |
Protected Member Functions | |
afterSerialize ($values) | |
isSerializedNode ($value) | |
serializeNode ($value) | |
deserializeNode ($value) | |
Protected Member Functions inherited from HierarchicalFormat | |
deserializeValues ($values) | |
serializeValues ($values) | |
isSerializedNode ($value) | |
isDeserializedNode ($value) | |
serializeNode ($value) | |
deserializeNode ($value) | |
Protected Member Functions inherited from AbstractFormat | |
getRequest () | |
getResponse () | |
beforeDeserialize ($values) | |
deserializeValues ($values) | |
afterDeserialize ($values) | |
beforeSerialize ($values) | |
serializeValues ($values) | |
afterSerialize ($values) | |
getNode (ObjectId $oid) | |
filterValue ($value, AttributeDescription $attribute) | |
Protected Attributes | |
$_serializer = null | |
Constructor & Destructor Documentation
__construct | ( | NodeSerializer | $serializer | ) |
Constructor.
- Parameters
-
$serializer NodeSerializer instance
Definition at line 43 of file JsonFormat.php.
Member Function Documentation
|
static |
Definition at line 50 of file JsonFormat.php.
getMimeType | ( | ) |
|
protected |
Definition at line 74 of file JsonFormat.php.
|
protected |
Definition at line 89 of file JsonFormat.php.
|
protected |
Definition at line 96 of file JsonFormat.php.
|
protected |
Definition at line 104 of file JsonFormat.php.
Member Data Documentation
|
protected |
Definition at line 37 of file JsonFormat.php.