Class GroovyContext
java.lang.Object
org.jbehave.core.configuration.groovy.GroovyContext
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
-
Constructor Summary
ConstructorDescriptionGroovyContext
(groovy.lang.GroovyClassLoader classLoader, List<String> resources) GroovyContext
(groovy.lang.GroovyClassLoader classLoader, GroovyResourceFinder resourceFinder) GroovyContext
(List<String> resources) GroovyContext
(GroovyResourceFinder resourceFinder) -
Method Summary
Modifier and TypeMethodDescription<T> T
getInstanceOfType
(Class<T> type) newInstance
(Class<?> parsedClass) Creates an instance from the parsed Groovy class.newInstance
(String resource) Creates an object instance from the Groovy resource
-
Constructor Details
-
GroovyContext
public GroovyContext() -
GroovyContext
-
GroovyContext
-
GroovyContext
public GroovyContext(groovy.lang.GroovyClassLoader classLoader, GroovyResourceFinder resourceFinder) -
GroovyContext
-
-
Method Details
-
getInstances
-
getInstanceOfType
-
newInstance
Creates an object instance from the Groovy resource- Parameters:
resource
- the Groovy resource to parse- Returns:
- An Object instance
-
newInstance
Creates an instance from the parsed Groovy class. This method can be overriden to do some dependency injection on Groovy classes.- Parameters:
parsedClass
- the parsed Class to instantiate- Returns:
- An Object instance of the parsed Class
- Throws:
Exception
- if instantiation or injection fails
-