Package io.higson.runtime.core
Class HigsonSubContext
java.lang.Object
io.higson.runtime.engine.core.context.DefaultContext
io.higson.runtime.core.HigsonContext
io.higson.runtime.core.HigsonSubContext
- All Implemented Interfaces:
ParamContext
- Direct Known Subclasses:
Adapter
Class to be used as Higson sub-context.
Example:context structure:
# root
policy : Policy
risk : PolicyRisk
# Policy
rcd : date
risks : PolicyRisk* (collection)
# PolicyRisk
code : string
premium : number
status : string
Example usage in higson function:
...
for (risk in ctx.get('policy.risks')) {
//risk is a context anchored in current PolicyRisk object
def code = risk.getString('code')
// parameter 'par.risk.rate' has now access to different risk object on each call (not to the one that is put in the root
// of context structure).
def rate = higson.getNumber('par.risk.rate', ctx, 'risk', r)
...
}
- See Also:
-
Field Summary
Fields inherited from class io.higson.runtime.core.HigsonContext
SKIP_PARENT -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.higson.runtime.core.HigsonContext
get, getBoolean, getBooleanHolder, getBooleanType, getDate, getDateHolder, getDatetime, getDatetimeHolder, getDatetimeType, getDateType, getDecimal, getFirst, getInteger, getIntegerHolder, getIntegerType, getLocalDate, getLocalDateHolder, getLocalDatetime, getLocalDatetimeHolder, getLocalDateTimeType, getLocalDateType, getNumber, getNumberHolder, getNumberType, getString, getStringHolder, getStringType, initialize, toStringMethods inherited from class io.higson.runtime.engine.core.context.DefaultContext
adhoc, get, get, getLevelValues, getUserContext, has, initialize, modifyKey, set, setLevelValues, with, with, withLevelValues, withLevelValues
-
Constructor Details
-
HigsonSubContext
-
-
Method Details
-
set
Description copied from class:HigsonContextPut given value object under specified path.- Overrides:
setin classHigsonContext- Parameters:
path- where object will be storedvalue- any object- Returns:
- the same context instance with stored value under the path
- See Also:
-
getNull
returns null representation for current context- Overrides:
getNullin classHigsonContext- Returns:
HigsonContext.SKIP_PARENT
-