Public Attributes |
const | EOF = 0 |
| Parse tokens used to decode the JSON object.
|
const | DATUM = 1 |
const | LBRACE = 2 |
const | LBRACKET = 3 |
const | RBRACE = 4 |
const | RBRACKET = 5 |
const | COMMA = 6 |
const | COLON = 7 |
Protected Member Functions |
| __construct ($source, $decodeType) |
| Constructor.
|
| _decodeValue () |
| Recursive driving rountine for supported toplevel tops.
|
| _decodeObject () |
| Decodes an object of the form: { "attribute: value, "attribute2" : value,...}.
|
| _decodeArray () |
| Decodes a JSON array format: [element, element2,...,elementN].
|
| _eatWhitespace () |
| Removes whitepsace characters from the source input.
|
| _getNextToken () |
| Retrieves the next token from the source stream.
|
Protected Attributes |
| $_source |
| $_sourceLength |
| $_offset |
| $_token |
| $_decodeType |
Constructor & Destructor Documentation
Zend_Json_Decoder::__construct |
( |
|
$source, |
|
|
|
$decodeType |
|
) |
| |
|
protected |
Constructor.
- Parameters
-
- Returns
- void
Member Function Documentation
Zend_Json_Decoder::_decodeArray |
( |
| ) |
|
|
protected |
Decodes a JSON array format: [element, element2,...,elementN].
- Returns
- array
Zend_Json_Decoder::_decodeObject |
( |
| ) |
|
|
protected |
Decodes an object of the form: { "attribute: value, "attribute2" : value,...}.
If ZJsonEnoder or ZJAjax was used to encode the original object then a special attribute called __className which specifies a class name that should wrap the data contained within the encoded source.
Decodes to either an array or StdClass object, based on the value of $_decodeType. If invalid $_decodeType present, returns as an array.
- Returns
- array|StdClass
Zend_Json_Decoder::_decodeValue |
( |
| ) |
|
|
protected |
Recursive driving rountine for supported toplevel tops.
- Returns
- mixed
Zend_Json_Decoder::_getNextToken |
( |
| ) |
|
|
protected |
Retrieves the next token from the source stream.
- Returns
- int Token constant value specified in class definition
Decode a JSON source string.
Decodes a JSON encoded string. The value returned will be one of the following:
- integer
- float
- boolean
- null
StdClass
- array
- array of one or more of the above types
By default, decoded objects will be returned as associative arrays; to return a StdClass object instead, pass Zend_Json::TYPE_OBJECT to the $objectDecodeType parameter.
Throws a Zend_Json_Exception if the source string is null.
public
- Parameters
-
- Returns
- mixed
- Exceptions
-
Member Data Documentation
const Zend_Json_Decoder::EOF = 0 |
Parse tokens used to decode the JSON object.
These are not for public consumption, they are just used internally to the class.
The documentation for this class was generated from the following file: