# JSON content model #

The JSON content model is used to access content stored in JSON format\. It provides a basic API to allow callers to extract values on the assumption that they know which values are to be accessed\.

<!-- <table "summary="Methods for the JSON content model" class="defaultstyle" "> -->

Methods for the JSON content model  

Table 1\. Methods for the JSON content model

| Method                                                                                    | Return types                               | Description                                                                                                                                                                                                                                                                       |
| ----------------------------------------------------------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getJSONAsString()`                                                                       | `String`                                   | Returns the JSON content as a string\.                                                                                                                                                                                                                                            |
| `getObjectAt(<List of cbjecta> path, JSONArtifact artifact) throws Exception`       | `Object`                                   | Returns the object at the specified path\. The supplied root artifact might be null, in which case the root of the content is used\. The returned value can be a literal string, integer, real or boolean, or a JSON artifact (either a JSON object or a JSON array)\.            |
| `getChildValuesAt(<List of object> path, JSONArtifact artifact) throws Exception`   | `Hash table (key:object, value:object>` | Returns the child values of the specified path if the path leads to a JSON object or null otherwise\. The keys in the table are strings while the associated value can be a literal string, integer, real or boolean, or a JSON artifact (either a JSON object or a JSON array)\. |
| `getChildrenAt(<List of object> path path, JSONArtifact artifact) throws Exception` | `List of objects`                          | Returns the list of objects at the specified path if the path leads to a JSON array or null otherwise\. The returned values can be a literal string, integer, real or boolean, or a JSON artifact (either a JSON object or a JSON array)\.                                        |
| `reset()`                                                                                 | `void`                                     | Flushes any internal storage associated with this content model (for example, a cached DOM object)\.                                                                                                                                                                              |

<!-- </table "summary="Methods for the JSON content model" class="defaultstyle" "> -->

<!-- </article "role="article" "> -->