Skip to main content

%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
classmethod %ConvertInfixToRPM(tokens As %DynamicArray) as %DynamicArray
classmethod %CorrelateValue(context, jpl As %String, lookupArray As %DynamicArray) as %DynamicObject
classmethod %DeleteValue(context, jpl As %String) as %DynamicObject
classmethod %EnummerateArrayAccessor(context, accessor As %DynamicArray) as %DynamicObject
classmethod %EnummerateGlobalAccessor(globalName, accessor As %DynamicArray, path) as %DynamicObject
classmethod %Error(shortForm, token)
classmethod %EvalOffsetExpression(aStack As %DynamicArray, last As %Integer) as %Integer
classmethod %EvaluateFilter(expr As %DynamicArray, context) as %Boolean
classmethod %FilterDynamicArray(jpl As %DynamicArray, startKey As %Integer, context As %DynamicArray, path As %String = "$", operation As %DynamicObject, aetIndex="") as %DynamicArray
classmethod %FilterDynamicObject(jpl As %String, startKey As %Integer, context As %DynamicObject, path As %String = "$", operation As %DynamicObject, aetIndex) as %DynamicArray
classmethod %FilterGlobal(jpl As %String, startKey As %Integer, context As %String, path As %String = "$") as %DynamicArray
classmethod %IndexFilterDynamicObject(jpl As %String, startKey As %Integer, context As %DynamicObject, path As %String = "$", operation As %DynamicObject, aetIndex) as %DynamicArray
Deal with the specialty case of depth wildcards
classmethod %MapPathToIndex(jpl As %DynamicArray, startKey As %Integer, globalName As %String, path As %String) as %DynamicArray
classmethod %ParseExpression(pExpression="") as %DynamicArray
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
classmethod %RecurseFilterDynamicObject(jpl As %String, startKey As %Integer, context As %DynamicObject, path As %String = "$", operation As %DynamicObject) as %DynamicArray
Deal with the specialty case of depth wildcards
classmethod %ReplaceValue(context, jpl As %String, newValue) as %DynamicObject
classmethod %Select(jpl As %String, context, key=0, operation="", aetIndex="") as %DynamicArray
classmethod %SelectValueOnly(jpl As %String, context, idx=0) as %String
classmethod %SkipTo(targetType As %String, jpl As %DynamicArray, startKey As %Integer = 0) as %Integer
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)
classmethod %TokenizeArrayAccessor(jpl As %String) as %DynamicArray
Parse an individual array accessor into a branch of a parse tree
classmethod %TokenizeFilter(jpl As %String) as %DynamicArray
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
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
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
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")
classmethod ProjectArrayAsString(node As %DynamicArray) as %String
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

Inherited Members

Inherited Methods

FeedbackOpens in a new tab