Package io.higson.runtime.decoder
Class CascadeDecoder
java.lang.Object
io.higson.runtime.engine.core.decoder.StandardDecoder
io.higson.runtime.decoder.CascadeDecoder
- All Implemented Interfaces:
ValueDecoder
Decoder that is used internally to decode and call Higson parameters and functions.
- Author:
- przemek hertel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncascadeCall(String functionCode, ParamContext ctx) calls function usingHigsonEnginethat was passed in constructorcascadeCall(String functionCode, Type<?> type, ParamContext ctx) calls function usingHigsonEnginethat was passed in constructor.cascadeFlowCall(String flowCode, ParamContext ctx) invokes flow usingHigsonEnginethat was passed in constructor.cascadeGet(String parameterCode, ParamContext ctx) invokes parameter usingHigsonEnginethat was passed in constructorcascadeGet(String parameterCode, Type<?> type, ParamContext ctx) invokes parameter usingHigsonEnginethat was passed in constructor.cascadeGetMultiValues(String parameterCode, ParamContext ctx) invokes parameter usingHigsonEnginethat was passed in constructorcascadeUtilCall(String functionCode, ParamContext ctx) decode(String text, Type<?> type, ParamContext ctx) decodes giventextto specificValueHolder.
-
Constructor Details
-
CascadeDecoder
defauld cascade constructor- Parameters:
engine- Implementation ofHigsonEnginethat is used to call decoded parameters and functions
-
-
Method Details
-
decode
decodes giventextto specificValueHolder. If text contains special prefixes $f or $p then function/parameter code is extracted from text and called usingHigsonEngine. If text does NOT contain special prefixes, then decoding is passed toStandardDecoder.decode(String, Type, ParamContext)- Specified by:
decodein interfaceValueDecoder- Overrides:
decodein classStandardDecoder- Parameters:
text- contains value to decode, for example:- simple text
- 1234
- 2018-01-15 09:10:11
- $f higson.test.function
- $p higson.test.param
- $u gt(path, 20)
type- implementation ofTypethat will be used to convert result of parameter/function (if text contains special prefixes $f or $p) or simple value fromtextargumentctx- implementation ofParamContextthat is passed to parameter/function invocation- Returns:
- specific implementation of
ValueHoldercontaining decoded value - See Also:
-
cascadeCall
calls function usingHigsonEnginethat was passed in constructor- Parameters:
functionCode- cascade function code (without $f) that will be called. Code examples:- higson.example.fun
- higson.example.fun(1, 2)
- higson.example.fun(ctx:policy.insurer.age, 7)
ctx- implementation ofParamContextthat is passed to function invocation- Returns:
- raw result of function invocation
- See Also:
-
cascadeFlowCall
invokes flow usingHigsonEnginethat was passed in constructor.- Parameters:
flowCode- cascade parameter code (without $w) that will be invoked. Code examples:- higson.example.flow
- higson.example.flow[flowKey]
ctx- implementation ofParamContextthat is passed to flow invocation- Returns:
- result of flow invocation FlowResult or result of flow invocation for specific flowKey
- See Also:
-
(String, ParamContext)
-
cascadeUtilCall
-
cascadeCall
calls function usingHigsonEnginethat was passed in constructor. If function result is a simple type then it is converted to specificValueHolderfrom passedtype- Parameters:
functionCode- cascade function code (without $f) that will be called. Code examples:- higson.example.fun
- higson.example.fun(1, 2)
- higson.example.fun(ctx:policy.insurer.age, 7)
type- implementation ofTypethat will be used to convert function result if returned object is simple typectx- implementation ofParamContextthat is passed to function invocation- Returns:
- converted result of function invocation, if function returns simple value, raw function result otherwise
- See Also:
-
cascadeGet
invokes parameter usingHigsonEnginethat was passed in constructor. If parameter result is a simple type then it is converted to specificValueHolderfrom passedtype- Parameters:
parameterCode- cascade parameter code (without $p) that will be invoked. Code examples:- higson.example.param
- higson.example.param[1]
- higson.example.param[factor]
type- implementation ofTypethat will be used to convert parameter result if returned object is simple typectx- implementation ofParamContextthat is passed to parameter invocation- Returns:
- converted result of parameter invocation, if parameter returns simple value, raw parameter result otherwise
- See Also:
-
cascadeGet
invokes parameter usingHigsonEnginethat was passed in constructor- Parameters:
parameterCode- cascade parameter code (without $p) that will be invoked. Code examples:- higson.example.param
- higson.example.param[1]
- higson.example.param[factor]
ctx- implementation ofParamContextthat is passed to parameter invocation- Returns:
- instance of
ValueHolder - See Also:
-
cascadeGetMultiValues
invokes parameter usingHigsonEnginethat was passed in constructor- Parameters:
parameterCode- cascade parameter code (without $p) that will be invoked. Code examples:- higson.example.param
- higson.example.param[1]
- higson.example.param[factor]
ctx- implementation ofParamContextthat is passed to parameter invocation- Returns:
- instance of
MultiValue - See Also:
-