Package net.officefloor.polyglot.script
Class AbstractScriptFunctionSectionSource
- java.lang.Object
-
- net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
-
- net.officefloor.plugin.section.clazz.AbstractFunctionSectionSource
-
- net.officefloor.polyglot.script.AbstractScriptFunctionSectionSource
-
- All Implemented Interfaces:
SectionSource
- Direct Known Subclasses:
JavaScriptFunctionSectionSource
public abstract class AbstractScriptFunctionSectionSource extends AbstractFunctionSectionSource
Abstract script functionSectionSource
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractScriptFunctionSectionSource.ScriptSection
Script sectionClass
.-
Nested classes/interfaces inherited from class net.officefloor.plugin.section.clazz.AbstractFunctionSectionSource
AbstractFunctionSectionSource.ObjectForMethod
-
Nested classes/interfaces inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
AbstractSectionSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_ENGINE_NAME
Property
name for theScriptEngine
name.static java.lang.String
PROPERTY_FUNCTION_NAME
Property
name for the Script function name.-
Fields inherited from class net.officefloor.plugin.section.clazz.AbstractFunctionSectionSource
CLASS_OBJECT_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractScriptFunctionSectionSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected SectionFunctionNamespace
adddSectionFunctionNamespace(java.lang.String namespace, java.lang.Class<?> sectionClass)
Adds theSectionFunctionNamespace
.protected abstract java.lang.String
getMetaDataScriptPath(SourceContext context)
Obtains the path to the script that extracts the function meta-data.protected abstract java.lang.String
getScriptEngineName(SourceContext context)
Obtains the name of theScriptEngine
.protected ScriptExceptionTranslator
getScriptExceptionTranslator()
Obtains theScriptExceptionTranslator
.protected java.lang.Class<?>
getSectionClass(java.lang.String sectionClassName)
Obtains the section class.protected java.lang.String
getSetupScriptPath(SourceContext context)
Obtains the path to the setup script.protected FunctionNamespaceType
loadFunctionNamespaceType(java.lang.String namespace, java.lang.Class<?> sectionClass)
Loads theFunctionNamespaceType
.protected AbstractFunctionSectionSource.ObjectForMethod
loadObjectForMethod(java.lang.Class<?> sectionClass)
-
Methods inherited from class net.officefloor.plugin.section.clazz.AbstractFunctionSectionSource
createClassManagedObject, enrichFunction, extractClassManagedObjectDependencies, getContext, getDesigner, getFunctionByName, getFunctionByTypeName, getFunctionName, getFunctionTypeByName, getManagedObject, getOrCreateInput, getOrCreateObject, getOrCreateOutput, getOrCreateSubSection, getSectionClassName, isIncludeManagedFunctionType, linkFunctionEscalation, linkFunctionFlow, linkFunctionFlow, linkFunctionObject, linkNextFunction, loadSpecification, registerFunctionByTypeName, sourceSection
-
Methods inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
getSpecification
-
-
-
-
Field Detail
-
PROPERTY_ENGINE_NAME
public static final java.lang.String PROPERTY_ENGINE_NAME
Property
name for theScriptEngine
name.- See Also:
- Constant Field Values
-
PROPERTY_FUNCTION_NAME
public static final java.lang.String PROPERTY_FUNCTION_NAME
Property
name for the Script function name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getScriptEngineName
protected abstract java.lang.String getScriptEngineName(SourceContext context) throws java.lang.Exception
Obtains the name of theScriptEngine
.- Parameters:
context
-SourceContext
.- Returns:
- Name of the
ScriptEngine
. - Throws:
java.lang.Exception
- If fails to obtain the name of theScriptEngine
.
-
getSetupScriptPath
protected java.lang.String getSetupScriptPath(SourceContext context) throws java.lang.Exception
Obtains the path to the setup script.- Parameters:
context
-SourceContext
.- Returns:
- Path to the setup script or
null
if no setup. - Throws:
java.lang.Exception
- If fails to obtain the setup script path.
-
getMetaDataScriptPath
protected abstract java.lang.String getMetaDataScriptPath(SourceContext context) throws java.lang.Exception
Obtains the path to the script that extracts the function meta-data.- Parameters:
context
-SourceContext
.- Returns:
- Path to the script that extracts the function meta-data.
- Throws:
java.lang.Exception
- If fails to obtain the path to the function meta-data script.
-
getScriptExceptionTranslator
protected ScriptExceptionTranslator getScriptExceptionTranslator()
Obtains theScriptExceptionTranslator
.- Returns:
ScriptExceptionTranslator
.
-
getSectionClass
protected java.lang.Class<?> getSectionClass(java.lang.String sectionClassName) throws java.lang.Exception
Description copied from class:AbstractFunctionSectionSource
Obtains the section class.- Overrides:
getSectionClass
in classAbstractFunctionSectionSource
- Parameters:
sectionClassName
- Name of the section class.- Returns:
- Section class.
- Throws:
java.lang.Exception
- If fails to obtain the section class.
-
loadObjectForMethod
protected AbstractFunctionSectionSource.ObjectForMethod loadObjectForMethod(java.lang.Class<?> sectionClass) throws java.lang.Exception
Description copied from class:AbstractFunctionSectionSource
- Overrides:
loadObjectForMethod
in classAbstractFunctionSectionSource
- Parameters:
sectionClass
-Class
of theObject
.- Returns:
AbstractFunctionSectionSource.ObjectForMethod
. May benull
for noObject
forMethod
.- Throws:
java.lang.Exception
- If fails to loadObject
for theMethod
.
-
loadFunctionNamespaceType
protected FunctionNamespaceType loadFunctionNamespaceType(java.lang.String namespace, java.lang.Class<?> sectionClass)
Description copied from class:AbstractFunctionSectionSource
Loads theFunctionNamespaceType
.- Overrides:
loadFunctionNamespaceType
in classAbstractFunctionSectionSource
- Parameters:
namespace
- Namespace.sectionClass
- SectionClass
.- Returns:
FunctionNamespaceType
.
-
adddSectionFunctionNamespace
protected SectionFunctionNamespace adddSectionFunctionNamespace(java.lang.String namespace, java.lang.Class<?> sectionClass)
Description copied from class:AbstractFunctionSectionSource
Adds theSectionFunctionNamespace
.- Overrides:
adddSectionFunctionNamespace
in classAbstractFunctionSectionSource
- Parameters:
namespace
- Namespace.sectionClass
- SectionClass
.- Returns:
SectionFunctionNamespace
.
-
-