S
- the Script interfacepublic abstract class AbstractScriptLanguageFactory<S> extends java.lang.Object implements ScriptLanguageFactory<S>
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractScriptLanguageFactory.BuilderCreator
The BuilderCreator class allows to create ScriptBuilders.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Short,java.lang.Class<ScriptBuilder>> |
builderClasses
The Map of ScriptBuilder classes for each script type.
|
protected org.scripthelper.context.ScriptContext |
context
The ScriptContext.
|
protected org.scripthelper.exceptions.ScriptExceptionListener |
exceptionListener
The Script ExceptionListener.
|
protected java.lang.ClassLoader |
loader
The ClassLoader.
|
protected org.scripthelper.context.ScriptLogger |
logger
The script logger.
|
protected java.util.Map<java.lang.Short,java.lang.Boolean> |
scriptSupported
The Map of mimes and their support in the factory.
|
protected java.util.Map<java.lang.Short,java.lang.Class<org.scripthelper.model.ScriptWrapper<S>>> |
wrapperClasses
The Map of ScriptWrapper classes for each script type.
|
Constructor and Description |
---|
AbstractScriptLanguageFactory() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.Class<ScriptBuilder> |
createBuilderClass(short scriptType)
Create the builder class for a specified MIME type.
|
protected java.lang.Class<ScriptBuilder> |
createBuilderClassImpl(java.lang.String path)
Create the builder class at the specified path.
|
org.scripthelper.model.ScriptWrapper<S> |
createScript(short scriptType)
Create a script wrapper.
|
org.scripthelper.model.ScriptWrapper |
createScriptWrapper(short scriptType,
org.scripthelper.js.JSScriptable scriptable)
Create a script wrapper.
|
protected java.lang.Class<ScriptBuilder> |
getBuilderClass(short scriptType)
Return the builder class for a MIME type.
|
org.scripthelper.context.ScriptContext |
getScriptContext()
Return the script context.
|
org.scripthelper.exceptions.ScriptExceptionListener |
getScriptExceptionListener()
Return the script exception listener.
|
java.lang.Class<S> |
getScriptInterface()
Return the class of the associated script interface.
|
org.scripthelper.context.ScriptLogger |
getScriptLogger()
Return the script logger.
|
boolean |
isScriptSupported(short scriptType)
Return true if the MIME type is supported.
|
protected boolean |
isSupported(short scriptType,
java.lang.String libPath)
Return true if the builder at a specified buildpath support specified scripts.
|
void |
setClassLoader(java.lang.ClassLoader loader)
Set the ClassLoader
|
void |
setScriptContext(org.scripthelper.context.ScriptContext context)
Set the script context.
|
void |
setScriptExceptionListener(org.scripthelper.exceptions.ScriptExceptionListener exceptionListener)
Set the script exception listener.
|
void |
setScriptLogger(org.scripthelper.context.ScriptLogger scriptLogger)
Set the script logger.
|
protected final java.util.Map<java.lang.Short,java.lang.Boolean> scriptSupported
protected java.lang.ClassLoader loader
protected final java.util.Map<java.lang.Short,java.lang.Class<org.scripthelper.model.ScriptWrapper<S>>> wrapperClasses
protected final java.util.Map<java.lang.Short,java.lang.Class<ScriptBuilder>> builderClasses
protected org.scripthelper.context.ScriptContext context
protected org.scripthelper.exceptions.ScriptExceptionListener exceptionListener
protected org.scripthelper.context.ScriptLogger logger
public void setClassLoader(java.lang.ClassLoader loader)
setClassLoader
in interface ScriptLanguageFactory<S>
loader
- the ClassLoaderpublic void setScriptExceptionListener(org.scripthelper.exceptions.ScriptExceptionListener exceptionListener)
setScriptExceptionListener
in interface ScriptLanguageFactory<S>
exceptionListener
- the script exception listenerpublic org.scripthelper.exceptions.ScriptExceptionListener getScriptExceptionListener()
getScriptExceptionListener
in interface ScriptLanguageFactory<S>
public void setScriptLogger(org.scripthelper.context.ScriptLogger scriptLogger)
setScriptLogger
in interface ScriptLanguageFactory<S>
scriptLogger
- the script loggerpublic org.scripthelper.context.ScriptLogger getScriptLogger()
getScriptLogger
in interface ScriptLanguageFactory<S>
public void setScriptContext(org.scripthelper.context.ScriptContext context)
setScriptContext
in interface ScriptLanguageFactory<S>
context
- the script contextpublic org.scripthelper.context.ScriptContext getScriptContext()
getScriptContext
in interface ScriptLanguageFactory<S>
public java.lang.Class<S> getScriptInterface()
getScriptInterface
in interface ScriptLanguageFactory<S>
public org.scripthelper.model.ScriptWrapper<S> createScript(short scriptType)
createScript
in interface ScriptLanguageFactory<S>
scriptType
- the script typeprotected boolean isSupported(short scriptType, java.lang.String libPath)
scriptType
- the script typelibPath
- the builder pathprotected java.lang.Class<ScriptBuilder> createBuilderClassImpl(java.lang.String path)
path
- the pathprotected java.lang.Class<ScriptBuilder> getBuilderClass(short scriptType)
scriptType
- the script typepublic org.scripthelper.model.ScriptWrapper createScriptWrapper(short scriptType, org.scripthelper.js.JSScriptable scriptable)
createScriptWrapper
in interface ScriptLanguageFactory<S>
scriptType
- the script typescriptable
- the JSScriptable (u=only used for Javascript scripts)protected abstract java.lang.Class<ScriptBuilder> createBuilderClass(short scriptType)
scriptType
- the script typepublic boolean isScriptSupported(short scriptType)
isScriptSupported
in interface ScriptLanguageFactory<S>
scriptType
- the script typeCopyright © 2008-2020 Herve Girod. All Rights Reserved. Documentation and source under the LGPL licence