Package io.appform.hope.lang
Class HopeLangEngine.Builder
- java.lang.Object
-
- io.appform.hope.lang.HopeLangEngine.Builder
-
- Enclosing class:
- HopeLangEngine
public static class HopeLangEngine.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HopeLangEngine.BuilderaddPackage(String userPackage)Add a package that will be scanned besides stdlib for implementations ofHopeFunctionHopeLangEnginebuild()Build a Hope language parserHopeLangEngine.BuildererrorHandlingStrategy(ErrorHandlingStrategy errorHandlingStrategy)Override error handling strategy.HopeLangEngine.BuilderregisterFunction(Class<? extends HopeFunction> hopeFunctionClass)Register aHopeFunctionimplementation directly to the function registry
-
-
-
Method Detail
-
addPackage
public HopeLangEngine.Builder addPackage(String userPackage)
Add a package that will be scanned besides stdlib for implementations ofHopeFunction- Parameters:
userPackage- package to be scanned- Returns:
- builder
-
registerFunction
public HopeLangEngine.Builder registerFunction(Class<? extends HopeFunction> hopeFunctionClass)
Register aHopeFunctionimplementation directly to the function registry- Parameters:
hopeFunctionClass- Implementation ofHopeFunction. Needs to be annotated withFunctionImplementationand have a constructor only having zero or moreValueas params.- Returns:
- builder
-
errorHandlingStrategy
public HopeLangEngine.Builder errorHandlingStrategy(ErrorHandlingStrategy errorHandlingStrategy)
Override error handling strategy. Default isDefaultErrorHandlingStrategy. Can also beInjectValueErrorHandlingStrategyor something custom.- Parameters:
errorHandlingStrategy- Error handling strategy- Returns:
- builder
-
build
public HopeLangEngine build()
Build a Hope language parser- Returns:
- a fully initialized immutable parser
-
-