Package io.appform.hope.core.functions
Class FunctionRegistry
- java.lang.Object
-
- io.appform.hope.core.functions.FunctionRegistry
-
public class FunctionRegistry extends Object
A global registry of functions provided by library as well as registered by user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFunctionRegistry.ConstructorMetastatic classFunctionRegistry.FunctionMeta
-
Constructor Summary
Constructors Constructor Description FunctionRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddiscover(List<String> packages)Discover and registerHopeFunctionimplementations that are annotated withFunctionImplementation.Optional<FunctionRegistry.FunctionMeta>find(String name)Find aHopeFunctionimplementation by name.voidregister(Class<? extends HopeFunction> clazz)Register aHopeFunctionimplementation.
-
-
-
Method Detail
-
discover
public void discover(List<String> packages)
Discover and registerHopeFunctionimplementations that are annotated withFunctionImplementation.- Parameters:
packages- Extra packages to be scanned besides the standard library.
-
register
public void register(Class<? extends HopeFunction> clazz)
Register aHopeFunctionimplementation. Needs to be annotated withFunctionImplementation.- Parameters:
clazz- Function class.
-
find
public Optional<FunctionRegistry.FunctionMeta> find(String name)
Find aHopeFunctionimplementation by name.- Parameters:
name- Name for the function to find- Returns:
- Meta data for the function if found or null.
-
-