IP*Works! 2016 Android Edition
IP*Works! 2016 Android Edition
Questions / Feedback?

Json Configuration

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

JSON Configuration Settings

CacheContent:   If true, the original JSON is stored internally in a buffer.

This config controls whether or not the component retains the entire original JSON data in a buffer. This is used to retain the original JSON as opposed to returning generated JSON after parsing. The default value is true.

CloseInputStreamAfterProcess:   Determines whether or not the input stream is closed after processing.

Determines whether or not the input stream set by SetInputStream is closed after processing is complete. The default value is True.

CloseOutputStreamAfterProcess:   Determines whether or not the output stream is closed after processing.

Determines whether or not the output stream set by SetOutputStream is closed after processing is complete. The default value is True.

PrettyPrint:   Determines whether output is on one line or "pretty printed".

The value of this configuration setting determines whether output is generated as a single line of JSON or multiple, "pretty printed" lines. For a better understanding please take the example code below:

json.Config("PrettyPrint=true"); // false
json.StartObject();
json.PutName("data");
json.StartObject();
json.PutProperty("id", "3", 3);
json.PutProperty("first_name", "Emma", 2);
json.PutProperty("last_name", "Wong", 2);
json.PutProperty("avatar", "https://s3.amazonaws.com/uifaces/faces/twitter/olegpogodaev/128.jpg", 2);
json.EndObject();
json.EndObject();
json.Flush();
Console.WriteLine(json.OutputData);
With PrettyPrint set to False (the default) the output would be this:
{"data":{"id":3,"first_name":"Emma","last_name":"Wong","avatar":"https:\/\/s3.amazonaws.com\/uifaces\/faces\/twitter\/olegpogodaev\/128.jpg"}}
With PrettyPrint set to True the output would instead be this:
{
  "data": {
    "id": 3,
    "first_name": "Emma",
    "last_name": "Wong",
    "avatar": "https:\/\/s3.amazonaws.com\/uifaces\/faces\/twitter\/olegpogodaev\/128.jpg"
  }
}
The default value is False.
StringProcessingOptions:   Defines options to use when processing string values.

This setting determines what additional processing is performed on string values during parsing. By default no additional processing is performed and the string is returned as is from the document. Strings may also be unquoted, unescaped, or both. Possible values are:

0 (none - default)No additional processing is performed.
1 (unquote) Strings are unquoted.
2 (unescape) Any escaped sequences are unescaped.
3 (unquote and unescape) Values are both unquoted and unescaped.

For instance, given the JSON element:

"example" : "value\ntest"
The following table shows the resulting value for the XText of the element.

StringProcessingOptionOutput
0 (none)
"value\ntest"
1 (unquote)
value\ntest
2 (unescape)
"value
test"
3 (unquote and unescape)
value
test

XPathNotation:   Specifies the expected format when setting XPath.

This setting optionally specifies the expected input format when setting XPath. Possible values are:

  • 0 (Auto - default)
  • 1 (XPath)
  • 2 (JSONPath)
In most cases the default of 0 (Auto) is sufficient. The component will determine whether the path value is in XPath or JSONPath format automatically. If desired the type may be explicitly set to either XPath or JSONPath using the values above.

Base Configuration Settings

GUIAvailable:   Tells the component whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GuiAvailable to false will ensure that the component does not attempt to process external events.

UseDaemonThreads:   Whether threads created by the component are daemon threads.

If set to True (default), when the component creates a thread the thread's Daemon property will be explicitly set to True. When set to False the component will not set the Daemon property on the created thread. The default value is True.

UseInternalSecurityAPI:   Tells the component whether or not to use the system security libraries or an internal implementation.

By default the component will use the system security libraries to perform cryptographic functions. Setting this to True tells the component to use the internal implementation instead of using the system's security API.

 
 
Copyright (c) 2020 /n software inc. - All rights reserved.
IP*Works! 2016 Android Edition - Version 16.0 [Build 7353]