Package net.officefloor.polyglot.script
Class ScriptManagedFunctionSource
- java.lang.Object
-
- net.officefloor.compile.spi.managedfunction.source.impl.AbstractManagedFunctionSource
-
- net.officefloor.polyglot.script.ScriptManagedFunctionSource
-
- All Implemented Interfaces:
ManagedFunctionSource
public class ScriptManagedFunctionSource extends AbstractManagedFunctionSource
ManagedFunctionSource
for JavaScript function.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.compile.spi.managedfunction.source.impl.AbstractManagedFunctionSource
AbstractManagedFunctionSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_ENGINE_NAME
Property
name for theScriptEngine
.static java.lang.String
PROPERTY_FUNCTION_NAME
Property
name for the JavaScript function name.static java.lang.String
PROPERTY_METADATA_SCRIPT_PATH
Property
name for the location of the Script to extra meta-data for the function.static java.lang.String
PROPERTY_SCRIPT_PATH
Property
name for the location of the Script file on the class path.static java.lang.String
PROPERTY_SETUP_SCRIPT_PATH
Property
name for optional script file to load to setup.
-
Constructor Summary
Constructors Constructor Description ScriptManagedFunctionSource()
Default constructor.ScriptManagedFunctionSource(ScriptExceptionTranslator scriptExceptionTranslator)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
loadSpecification(AbstractManagedFunctionSource.SpecificationContext context)
Loads theManagedFunctionSourceSpecification
.void
sourceManagedFunctions(FunctionNamespaceBuilder functionNamespaceTypeBuilder, ManagedFunctionSourceContext context)
Sources theFunctionNamespaceType
by populating it via the inputFunctionNamespaceBuilder
.-
Methods inherited from class net.officefloor.compile.spi.managedfunction.source.impl.AbstractManagedFunctionSource
getSpecification
-
-
-
-
Field Detail
-
PROPERTY_ENGINE_NAME
public static final java.lang.String PROPERTY_ENGINE_NAME
Property
name for theScriptEngine
.- See Also:
- Constant Field Values
-
PROPERTY_SETUP_SCRIPT_PATH
public static final java.lang.String PROPERTY_SETUP_SCRIPT_PATH
Property
name for optional script file to load to setup.- See Also:
- Constant Field Values
-
PROPERTY_SCRIPT_PATH
public static final java.lang.String PROPERTY_SCRIPT_PATH
Property
name for the location of the Script file on the class path.- See Also:
- Constant Field Values
-
PROPERTY_METADATA_SCRIPT_PATH
public static final java.lang.String PROPERTY_METADATA_SCRIPT_PATH
Property
name for the location of the Script to extra meta-data for the function.- See Also:
- Constant Field Values
-
PROPERTY_FUNCTION_NAME
public static final java.lang.String PROPERTY_FUNCTION_NAME
Property
name for the JavaScript function name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScriptManagedFunctionSource
public ScriptManagedFunctionSource()
Default constructor.
-
ScriptManagedFunctionSource
public ScriptManagedFunctionSource(ScriptExceptionTranslator scriptExceptionTranslator)
Instantiate.- Parameters:
scriptExceptionTranslator
-ScriptExceptionTranslator
.
-
-
Method Detail
-
loadSpecification
protected void loadSpecification(AbstractManagedFunctionSource.SpecificationContext context)
Description copied from class:AbstractManagedFunctionSource
Loads theManagedFunctionSourceSpecification
.- Specified by:
loadSpecification
in classAbstractManagedFunctionSource
- Parameters:
context
-AbstractManagedFunctionSource.SpecificationContext
.
-
sourceManagedFunctions
public void sourceManagedFunctions(FunctionNamespaceBuilder functionNamespaceTypeBuilder, ManagedFunctionSourceContext context) throws java.lang.Exception
Description copied from interface:ManagedFunctionSource
Sources theFunctionNamespaceType
by populating it via the inputFunctionNamespaceBuilder
.- Parameters:
functionNamespaceTypeBuilder
-FunctionNamespaceBuilder
to be populated with thetype definition
of theManagedFunctionSource
.context
-ManagedFunctionSourceContext
to source details to populate theFunctionNamespaceBuilder
.- Throws:
java.lang.Exception
- If fails to populate theFunctionNamespaceBuilder
.
-
-