# RHObject
Inherits from: RHObject
# Class Methods
# Destructor
function Void Destructor()
Called when the Frame is destroyed.
# ErrorAssoc
function Assoc ErrorAssoc(String errMsg=Undefined)
The ErrorAssoc
class method returns an Assoc
with an ok
key being false
and an
errMsg
key with the value of the parameter. It's a shortcut for calling OKAssoc(false, errMsg)
.
# Parameters
errMsg
- The error message in the error Assoc.
# New
function Dynamic New(Object prgCtx=Undefined)
# OKAssoc
function Assoc OKAssoc(Boolean ok=true, String errMsg=Undefined)
The OKAssoc
class method returns an Assoc
with ok
and errMsg
keys.
# Parameters
ok
- The value of the ok key (default true)errMsg
- The errMsg value in the Assoc, if ok is false
# Instance Methods
# Property Methods
Property methods can be accessed with the valueForKey
method.
classidentifier classname clone errorassoc hash identityhashcode iterator methods okassoc propertymethods reset serialize string
# assert
function Void assert(Boolean condition, String assertionErrorString="Assertion Error", Dynamic userInfo=Undefined)
Aborts execution of the thread and roles back any open transactions if a condition is false
.
# Parameters
condition
- The boolean condition to test.assertionErrorString
- A string that expresses why a condition should have resolved totrue
.userInfo
- Anything else you might want to capture in the logs.
# cacheMethod
function Dynamic cacheMethod(String methodName, List args={}, String key=$RHCore.Utils.Hash({methodName, @args}))
# cacheValueForKey
function Dynamic cacheValueForKey(Dynamic key, Dynamic defaultValue=Undefined)
# callSuper
function Dynamic callSuper(String methodName, List args={})
This method permits super
calls to be made on RHObject objects. It's more powerful than the
OScript super
reserved word and $RHCore.Utils.super()
calls since it allows super to be called
multiple times.
# Parameters
methodName
- The method to call, which should match the name of the method you're calling it from.args
- A list of args to pass in.
# Returns
The return value of the super call.
# checkError
function Assoc checkError(Dynamic status, String errMsg=Undefined)
This function attempts to harmonize various return values into a consistent return value Assoc.
# Parameters
status
- The value to check (e.g., Error, Integer, Assoc, etc.)errMsg
- (Optional) An error string.
# Returns
A return value Assoc.
# class
function Object class()
# classIdentifier
function String classIdentifier()
Returns a string that uniquely identifies this class. This should never be persisted outside of local memory.
# className
function String className()
Returns the class name of the object.
# Returns
The name of the class.
# clone
function Frame clone(Object prgCtx=.fPrgCtx)
Returns a clone of the object (not to be confused with "copy"). The reset()
method is called on the cloned object to clear out any cached values.
# Parameters
prgCtx
- (Optional) A program context, which can differ from the original (say tosu
the object).
# Returns
The cloned object.
# deserialize
function Assoc deserialize(Dynamic a)
The instance must exist.
# dict
function Assoc dict(Dynamic items)
# endTrans
function Boolean endTrans(Boolean commit)
# hash
function String hash()
# identityHashCode
function String identityHashCode()
# isAccessorMethod
function Boolean isAccessorMethod(String methodName)
# isCached
function Boolean isCached(String key)
# isInstanceOf
function Boolean isInstanceOf(String className)
# isProperty
function Boolean isProperty(String key)
# isPropertyMethod
function Boolean isPropertyMethod(String methodName)
# iterator
function Frame iterator()
# methods
function List methods()
The method name is a bit misleading and only returns accessor methods.
# pluck
function List pluck(Dynamic keypath)
# prepareForReuse
function Frame prepareForReuse()
This method is used by Iterator
to recycle an object during iteration.
The default implementation simply resets the object, which usually suffices. This method can be subclassed if reset() doesn't suffice.
# propertyMethods
function List propertyMethods()
# removeFromCache
function Dynamic removeFromCache(String key)
# reset
function Dynamic reset()
Reset is used in a few places:
._New() to intialize the object; reset the cache of the object after cloning; and reset the object for reuse in an iterator.
# resetCache
function Dynamic resetCache()
# resetSubclass
function Void resetSubclass()
# respondsTo
function Boolean respondsTo(String funcName, List interface={})
# serialize
function Dynamic serialize()
Generates a storable representation of a value.
# setCacheValueForKey
function Dynamic setCacheValueForKey(Dynamic item, Dynamic key, Boolean allowUndefined=false)
# setValueForKey
function Dynamic setValueForKey(Dynamic value, String key)
This is an abstract class method, but calls to setCacheValueForKey() as a convenience.
# setValueForKeyPath
function Dynamic setValueForKeyPath(List keyPath, Dynamic value)
# setValues
function Frame setValues(Dynamic values)
# startTrans
function Boolean startTrans()
# string
function String string()
This method returns a string
representation of the object.
# super
function Script super(String methodName)
# valueForKey
function Dynamic valueForKey(String key, Dynamic defaultValue=Undefined)
Consider overriding the _valueForKey()
method to implement specific behaviour.
# valueForKeyPath
function Dynamic valueForKeyPath(Dynamic keypath, Dynamic defaultValue=Undefined, String delim=".")