Home > Class Reference > ENSLIB namespace > %REST.JPLUtils

%REST.JPLUtils

This class is used internally by InterSystems IRIS. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

Method Inventory

Methods

classmethod %ClassifyContext(context) as %Integer [ Language = objectscript ]
classmethod %ConvertInfixToRPM(tokens As %DynamicArray) as %DynamicArray [ Language = objectscript ]
classmethod %CorrelateValue(context, jpl As %String, lookupArray As %DynamicArray) as %DynamicObject [ Language = objectscript ]
classmethod %DeleteValue(context, jpl As %String) as %DynamicObject [ Language = objectscript ]
classmethod %EnummerateArrayAccessor(context, accessor As %DynamicArray) as %DynamicObject [ Language = objectscript ]
classmethod %EnummerateGlobalAccessor(globalName, accessor As %DynamicArray, path) as %DynamicObject [ Language = objectscript ]
classmethod %Error(shortForm, token) [ Language = objectscript ]
classmethod %EvalOffsetExpression(aStack As %DynamicArray, last As %Integer) as %Integer [ Language = objectscript ]
classmethod %EvaluateFilter(expr As %DynamicArray, context) as %Boolean [ Language = objectscript ]
classmethod %FilterDynamicArray(jpl As %DynamicArray, startKey As %Integer, context As %DynamicArray, path As %String = "$", operation As %DynamicObject, aetIndex="") as %DynamicArray [ Language = objectscript ]
classmethod %FilterDynamicObject(jpl As %String, startKey As %Integer, context As %DynamicObject, path As %String = "$", operation As %DynamicObject, aetIndex) as %DynamicArray [ Language = objectscript ]
classmethod %FilterGlobal(jpl As %String, startKey As %Integer, context As %String, path As %String = "$") as %DynamicArray [ Language = objectscript ]
classmethod %IndexFilterDynamicObject(jpl As %String, startKey As %Integer, context As %DynamicObject, path As %String = "$", operation As %DynamicObject, aetIndex) as %DynamicArray [ Language = objectscript ]
Deal with the specialty case of depth wildcards
classmethod %MapPathToIndex(jpl As %DynamicArray, startKey As %Integer, globalName As %String, path As %String) as %DynamicArray [ Language = objectscript ]
classmethod %ParseExpression(pExpression="") as %DynamicArray [ Language = objectscript ]
Organize a JPL expression into a parse tree. Expressions must begin with either the root token '$' or the in-line '@' token.
classmethod %Query(context, jpl As %String, keys As %DynamicArray) as %DynamicObject [ Language = objectscript ]
classmethod %RecurseFilterDynamicObject(jpl As %String, startKey As %Integer, context As %DynamicObject, path As %String = "$", operation As %DynamicObject) as %DynamicArray [ Language = objectscript ]
Deal with the specialty case of depth wildcards
classmethod %ReplaceValue(context, jpl As %String, newValue) as %DynamicObject [ Language = objectscript ]
classmethod %Select(jpl As %String, context, key=0, operation="", aetIndex="") as %DynamicArray [ Language = objectscript ]
classmethod %SelectValueOnly(jpl As %String, context, idx=0) as %String [ Language = objectscript ]
classmethod %SkipTo(targetType As %String, jpl As %DynamicArray, startKey As %Integer = 0) as %Integer [ Language = objectscript ]
Return the next highest index of a node of type targetType, starting at (and including) position startKey in the given parse jpl expression. If the node does not occur in balance of the expression, return -1.
classmethod %StripToValueOnly(selectionArray As %DynamicArray) [ Language = objectscript ]
classmethod %TokenizeArrayAccessor(jpl As %String) as %DynamicArray [ Language = objectscript ]
Parse an individual array accessor into a branch of a parse tree
classmethod %TokenizeFilter(jpl As %String) as %DynamicArray [ Language = objectscript ]
Parse an individual filter expression into a branch of a parse tree
classmethod ApplyTransform(aet As %DynamicAbstractObject, path As %String, oper As %String, p1, p2, p3, index="") as %Integer [ Language = objectscript ]
Given a source data structure, a JPL path specification, an operation, and up to three (optional) arguments (which vary by operation), scope the operation based on the JPL, apply the transformation to the given tree, and return a count of the number of edit operations performed.

Standard operations are:
addKey - add an attributes with the name "p1" with value "p2" to the current location
callback - invoke a custom callback to process data at this point. The class name should be passed in p1, the method name should be passed in p2 and any additional user data should be passed in p3. The callback should be a classMethod that takes one argument, a %DynamicObject with attributes of: value, the node selected; nodePath, the JPL used to identify this node; parentNode, the currentNode's parent; attrName, the name or index value of this node with respect to its parent node; and userData, the value originally passed in p3. The callback method should return a value of 1 is an edit was made and 0 otherwise.
convertArrayToCSV - given an array of simple scalar types, convert them into a delimited string
convertArrayToKeyObject - given an array of objects p1, each with a common attribute named p2, break out each member of the array into a separate key:value pair where the value of p2 is used as a key. The original array is removed from the current object.
convertCSVToArray - given a delimited string, convert it into an array of simple scalars
convertKeysToArray - gather the attributes (of type object) of the current object into an array named p1. Embed each former attribute name into its sub-object as a value keyed to name p2. P3 holds a list of child key names that are exempt from this operation
convertStringToValueObject - given an attribute with a simple string value, convert the attribute to an object with a single key "#VALUE" which has as its value the former string value of the original attribute.
convertValueObjectToString - undoes the edits done by convertStringToValueObject.
deleteKey - remove an attributes with the name "p1" from the current object
deleteThis - remove the current attribute
renameKey - rename attributes with the name "p1" to "p2"
renameThis - rename the current attribute to "p1"
restructureArrayForXML - used for XML interoperability, this call converts the current array to an object with a single property "p1". P1 is a wrapper for the current array's actual values. Thus {Items[{key:0},{key:1}]} would become {Items:{Item:[{key:0},{key:1}]}} or, when projected to XML:
restructureArrayFromXML - This undoes the edits performed by restructureArrayForXML, replacing the valueof the current node with the contents of the child array named in p1
stripEmpties - recursively remove empty objects, empty arrays and null values from the given location downward. wrapObjectAsArray - given some attribute p1, turn p1 into an array holding one item, that being the former value of p1.

classmethod ApplyTransformMap(aet As %DynamicAbstractObject, map As %DynamicArray) as %Integer [ Language = objectscript ]
Given a source AET and a transformation map expressed as a %DynamicArray of transform tuples (cf. ApplyTransformObject()), apply the given transformation to the data structure and return the number of edits performed in the process.
classmethod ApplyTransformObject(aet As %DynamicAbstractObject, tuple As %DynamicObject) as %Integer [ Language = objectscript ]
Given a source AET and a transformation tuple expressed as a %DynamicObject, apply the given transformation to data structure and return the number of edits performed in the process.
The transformation tuple is dynamic object with the following attributes: "path", the JPL expression used to scope the operation; "operation", the edit to be performed (cf. ApplyTransform); and, up to three optional arguments for operation in question, named simply "p1", "p2" and "p3"
classmethod BuildAETIndex(aet As %DynamicAbstractObject, index As %DynamicObject, prefix="", nodeType="object") [ Language = objectscript ]
classmethod ProjectArrayAsString(node As %DynamicArray) as %String [ Language = objectscript ]
ApplyTransformation helper function Given a node that represents an array of strings flatten the array into a delimited string where the first character is the delimiter and data follows
classmethod StripEmptyValues(node, parent, nodeName, purgeStrings=1, purgeArrays=1, purgeObjects=1) as %Integer [ Language = objectscript ]

Inherited Members

Inherited Methods