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
-
Method Summary
Modifier and TypeMethodDescriptioncreateInline
(String... lines) Build a newScript
instance from the givenlines
representing the script content.createResource
(String resource) Build a newScript
instance 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:ScriptFactory
Initialize the factory with the givenenvironment
.- Specified by:
init
in 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:ScriptFactory
Build a newScript
instance from a resource name.The
resource
name can either:- a relative path to the script base directory
- an absolute URL
- Specified by:
createResource
in 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:ScriptFactory
Build a newScript
instance from the givenlines
representing the script content.- Specified by:
createInline
in interfaceScriptFactory
- Parameters:
lines
- script content- Returns:
- a new Script instance
- Throws:
ScriptException
- if any pre-validation failed
-
mimeType
Description copied from interface:ScriptFactory
Returns the mime-type of the script supported by this factory.- Specified by:
mimeType
in interfaceScriptFactory
- Returns:
- the mime-type of the script supported by this factory.
-