Package org.forgerock.openig.script
Class GroovyScriptFactory
java.lang.Object
org.forgerock.openig.script.GroovyScriptFactory
- All Implemented Interfaces:
ScriptFactory
Provide support for scripts written in the Groovy language.
Groovy files must be UTF-8 encoded.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInline(String... lines) Build a newScriptinstance from the givenlinesrepresenting the script content.createResource(String resource) Build a newScriptinstance from a resource name.init(Environment environment) Initialize the factory with the givenenvironment.mimeType()Returns the mime-type of the script supported by this factory.
-
Constructor Details
-
GroovyScriptFactory
public GroovyScriptFactory()
-
-
Method Details
-
init
Description copied from interface:ScriptFactoryInitialize the factory with the givenenvironment.- Specified by:
initin interfaceScriptFactory- Parameters:
environment- the current environment information- Returns:
- this factory to allow method chaining
- Throws:
ScriptException- if the initialization failed
-
createResource
Description copied from interface:ScriptFactoryBuild a newScriptinstance from a resource name.The
resourcename can either:- a relative path to the script base directory
- an absolute URL
- Specified by:
createResourcein interfaceScriptFactory- Parameters:
resource- Script resource name- Returns:
- a new Script instance
- Throws:
ScriptException- if resource is not available or if any pre-validation failed
-
createInline
Description copied from interface:ScriptFactoryBuild a newScriptinstance from the givenlinesrepresenting the script content.- Specified by:
createInlinein interfaceScriptFactory- Parameters:
lines- script content- Returns:
- a new Script instance
- Throws:
ScriptException- if any pre-validation failed
-
mimeType
Description copied from interface:ScriptFactoryReturns the mime-type of the script supported by this factory.- Specified by:
mimeTypein interfaceScriptFactory- Returns:
- the mime-type of the script supported by this factory.
-