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. | |||||||||||||||||||
ElementXPath:
The XPath value for the current element in the document. This setting holds the current XPath value when the document is parsed. When queried from inside the StartElement event, the corresponding element's XPath value will be returned. For instance: string elementXPath = json.Config( "ElementXPath" ); Note: The BuildDOM property must be set to false. | |||||||||||||||||||
EscapeForwardSlashes:
Whether to escape forward slashes when writing a JSON object. This setting specifies whether forward slashes (/) are escaped when creating a JSON object using the component. This does not affect parsing of JSON, only when JSON values are written. | |||||||||||||||||||
InputFormat:
Specifies the input format used in JSON streaming. This setting specifies how JSON documents are formatted as they are input to the component. This setting is designed for use when data is provided via JSON streaming. This means multiple documents may be parsed by the component. This setting is only applicable when BuildDOM is set to False. Possible values are:
| |||||||||||||||||||
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); { "data" :{ "id" :3, "first_name" : "Emma" , "last_name" : "Wong" , "avatar" : "https:\/\/s3.amazonaws.com\/uifaces\/faces\/twitter\/olegpogodaev\/128.jpg" }} { "data" : { "id" : 3, "first_name" : "Emma" , "last_name" : "Wong" , "avatar" : "https:\/\/s3.amazonaws.com\/uifaces\/faces\/twitter\/olegpogodaev\/128.jpg" } } | |||||||||||||||||||
RecordEndDelimiter:
The character sequence after the end of a JSON document. This setting is used in conjunction with InputFormat to specify the character sequence that is expected after the end of a JSON document. | |||||||||||||||||||
RecordStartDelimiter:
The character sequence before the start of a JSON document. This setting is used in conjunction with InputFormat to specify the character sequence that is expected before the start of a JSON document. | |||||||||||||||||||
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:
For instance, given the JSON element:
"example" : "value\ntest"
| |||||||||||||||||||
XPathNotation:
Specifies the expected format when setting XPath. This setting optionally specifies the expected input format when setting XPath. Possible values are:
|
Base Configuration Settings
BuildInfo:
Information about the product's build. When queried, this setting will return a string containing information about the product's build. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodePage:
The system code page used for Unicode to Multibyte translations. The default code page is Unicode UTF-8 (65001). The following is a list of valid code page identifiers:
The following is a list of valid code page identifiers for Mac OS only:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LicenseInfo:
Information about the current license. When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. |