lucee.Component
commandbox.system.services.JSONService
Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I am a collection of shared functionality for dealing with JSON files
| Property Summary | ||||
|---|---|---|---|---|
| type | property | default | serializable | required |
any
|
configService
|
true
|
false
|
|
any
|
fileSystemUtil
|
true
|
false
|
|
any
|
formatterUtil
|
true
|
false
|
|
any
|
logger
|
true
|
false
|
|
any
|
print
|
true
|
false
|
|
| Constructor Summary | |
|---|---|
|
init()
Constructor. |
|
| Method Summary | |
|---|---|
any
|
addProp([any props], [any prop], [any safeProp], [any targetStruct])
|
boolean
|
check(any JSON, string property)
I check for the existance of a property. |
any
|
clear(any JSON, string property)
I clear a property from a deserialized JSON object. |
any
|
getANSIColors()
Get ANSI colors for formatting JSON. |
string
|
getConfigService()
|
string
|
getFileSystemUtil()
|
string
|
getFormatterUtil()
|
string
|
getLogger()
|
string
|
getPrint()
|
any
|
isSortedJSON(any json, string sortKeys)
I check to see if a JSON object has sorted keys. |
any
|
set(any JSON, struct properties, boolean thisAppend)
I set a property from a deserialized JSON object and returns an array of messages regarding the word that was done. |
any
|
setConfigService(any configService)
|
any
|
setFileSystemUtil(any fileSystemUtil)
|
any
|
setFormatterUtil(any formatterUtil)
|
any
|
setLogger(any logger)
|
any
|
setPrint(any print)
|
any
|
show(any JSON, string property, [any defaultValue])
I get a property from a deserialized JSON object and return it. |
private any
|
toBracketNotation(string property)
|
any
|
writeJSONFile(string path, any json, [boolean locking='false'])
I write JSON objects to disk after pretty printing them. |
| Methods inherited from class lucee.Component |
|---|
| None |
| Constructor Detail |
|---|
Constructor
| Property Detail |
|---|
access - publicrequired - falsereturntype - anyinject - ConfigServiceserializable - trueaccess - publicrequired - falsereturntype - anyinject - FileSystemserializable - trueaccess - publicrequired - falsereturntype - anyinject - Formatterserializable - trueaccess - publicrequired - falsereturntype - anyinject - logbox:logger:{this}serializable - trueaccess - publicrequired - falsereturntype - anyinject - printserializable - true| Method Detail |
|---|
propspropsafeProptargetStructI check for the existance of a property
JSONpropertyI clear a property from a deserialized JSON object.
JSONpropertyGet ANSI colors for formatting JSON. Returns defaults if no settings are present
I check to see if a JSON object has sorted keys. (I also work for CFML objects that can be serialized to JSON.)
json - A string containing JSON, or a complex value that can be serialized to JSONsortKeys - The type of key sorting to check for - i.e. "text" or "textnocase"I set a property from a deserialized JSON object and returns an array of messages regarding the word that was done.
JSONpropertiesthisAppendconfigServicefileSystemUtilformatterUtilloggerprintI get a property from a deserialized JSON object and return it
JSONpropertydefaultValuepropertyI write JSON objects to disk after pretty printing them. (I also work for CFML objects that can be serialized to JSON.)
path - The file path to write tojson - A string containing JSON, or a complex value that can be serialized to JSONlocking - Set to true to have file system access wrapped in a lock