Class GroovyScriptInstantiator
java.lang.Object
org.exoplatform.services.script.groovy.GroovyScriptInstantiator
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
Constructor Summary
ConstructorsConstructorDescriptionGroovyScriptInstantiator(org.exoplatform.container.ExoContainerContext containerContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlugin(org.exoplatform.container.component.ComponentPlugin plugin) instantiateScript(groovy.lang.GroovyCodeSource codeSource, groovy.lang.GroovyClassLoader loader) Instantiate script from giveGroovyCodeSourceand use given class-loader.instantiateScript(InputStream stream) Parse given stream, the stream must represents groovy script.instantiateScript(InputStream stream, String name) Parse given stream, the stream must represents groovy script.instantiateScript(InputStream stream, String name, groovy.lang.GroovyClassLoader loader) Parse given stream, the stream must represents groovy script and use given class-loader.instantiateScript(String spec) Load script from given address.instantiateScript(URL url) Load script from given address.
-
Constructor Details
-
GroovyScriptInstantiator
public GroovyScriptInstantiator(org.exoplatform.container.ExoContainerContext containerContext) - Parameters:
containerContext- container context
-
-
Method Details
-
instantiateScript
Load script from given address.- Parameters:
spec- the resource's address.- Returns:
- the object created from groovy script.
- Throws:
MalformedURLException- if parameterurlhave wrong format.IOException- if can't load script from givenurl.- See Also:
-
instantiateScript
Load script from given address.- Parameters:
url- the resource's address.- Returns:
- the object created from groovy script.
- Throws:
IOException- if can't load script from givenurl.- See Also:
-
instantiateScript
Parse given stream, the stream must represents groovy script.- Parameters:
stream- the stream represented groovy script.- Returns:
- the object created from groovy script.
- Throws:
IOException- if stream can't be parsed or object can't be created cause to illegal content of stream
-
instantiateScript
Parse given stream, the stream must represents groovy script.- Parameters:
stream- the stream represented groovy script.name- script name is null or empty string that groovy completer will use default name- Returns:
- the object created from groovy script.
- Throws:
IOException- if stream can't be parsed or object can't be created cause to illegal content of stream
-
instantiateScript
public Object instantiateScript(InputStream stream, String name, groovy.lang.GroovyClassLoader loader) throws IOException Parse given stream, the stream must represents groovy script and use given class-loader. Ifloader == nullthenGroovyClassLoaderwill be is use.- Parameters:
stream- the stream represented groovy script.name- script name is null or empty string that groovy completer will use default nameloader- GroovyClassLoader ornull- Returns:
- the object created from groovy script.
- Throws:
IOException- if stream can't be parsed or object can't be created cause to illegal content of stream
-
instantiateScript
public Object instantiateScript(groovy.lang.GroovyCodeSource codeSource, groovy.lang.GroovyClassLoader loader) Instantiate script from giveGroovyCodeSourceand use given class-loader. Ifloader == nullthenGroovyClassLoaderwill be is use.- Parameters:
codeSource- code sourceloader-- Returns:
-
addPlugin
public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
-