Package org.intocps.maestro.interpreter
Class DefaultExternalValueFactory
- java.lang.Object
-
- org.intocps.maestro.interpreter.DefaultExternalValueFactory
-
- All Implemented Interfaces:
IExternalValueFactory
public class DefaultExternalValueFactory extends java.lang.Object implements IExternalValueFactory
Default interpreter factory with framework support and other basic features. This class provides run-time support only. It creates and destroys certain types based on load and unload
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringDATA_WRITER_TYPE_NAMEprotected java.util.HashMap<java.lang.String,java.util.function.Function<java.util.List<Value>,com.spencerwi.either.Either<java.lang.Exception,Value>>>instantiatorsprotected java.lang.StringMATH_TYPE_NAME
-
Constructor Summary
Constructors Constructor Description DefaultExternalValueFactory()DefaultExternalValueFactory(java.io.File workingDirectory, java.io.InputStream config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.spencerwi.either.Either<java.lang.Exception,Value>create(java.lang.String type, java.util.List<Value> args)Creates a new interpreter value for the specified type using the supplied argumentsValuedestroy(Value value)Destruction of values created by the factory.booleansupports(java.lang.String type)Check if a certain type is supported by the external value factory
-
-
-
Field Detail
-
DATA_WRITER_TYPE_NAME
protected final java.lang.String DATA_WRITER_TYPE_NAME
- See Also:
- Constant Field Values
-
MATH_TYPE_NAME
protected final java.lang.String MATH_TYPE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultExternalValueFactory
public DefaultExternalValueFactory() throws java.io.IOException- Throws:
java.io.IOException
-
DefaultExternalValueFactory
public DefaultExternalValueFactory(java.io.File workingDirectory, java.io.InputStream config) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
supports
public boolean supports(java.lang.String type)
Description copied from interface:IExternalValueFactoryCheck if a certain type is supported by the external value factory- Specified by:
supportsin interfaceIExternalValueFactory- Returns:
- true if the type is supported by
IExternalValueFactory.create(String, List)
-
create
public com.spencerwi.either.Either<java.lang.Exception,Value> create(java.lang.String type, java.util.List<Value> args)
Description copied from interface:IExternalValueFactoryCreates a new interpreter value for the specified type using the supplied arguments- Specified by:
createin interfaceIExternalValueFactory- Parameters:
type- the type to createargs- the arguments used to create the value- Returns:
- the value or an exception if creation fails
-
destroy
public Value destroy(Value value)
Description copied from interface:IExternalValueFactoryDestruction of values created by the factory. Destruction must make sure all resources hold by this value is freed- Specified by:
destroyin interfaceIExternalValueFactory- Parameters:
value- the value to destroy- Returns:
- void return
-
-