org.jbehave.core.configuration.groovy
Class GroovyContext

java.lang.Object
  extended by org.jbehave.core.configuration.groovy.GroovyContext

public class GroovyContext
extends Object


Nested Class Summary
static class GroovyContext.GroovyClassInstantiationFailed
           
static class GroovyContext.GroovyInstanceNotFound
           
 
Constructor Summary
GroovyContext()
           
GroovyContext(groovy.lang.GroovyClassLoader classLoader, GroovyResourceFinder resourceFinder)
           
GroovyContext(groovy.lang.GroovyClassLoader classLoader, List<String> resources)
           
GroovyContext(GroovyResourceFinder resourceFinder)
           
GroovyContext(List<String> resources)
           
 
Method Summary
<T> T
getInstanceOfType(Class<T> type)
           
 List<Object> getInstances()
           
 Object newInstance(Class<?> parsedClass)
          Creates an instance from the parsed Groovy class.
 Object newInstance(String resource)
          Creates an object instance from the Groovy resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyContext

public GroovyContext()

GroovyContext

public GroovyContext(GroovyResourceFinder resourceFinder)

GroovyContext

public GroovyContext(List<String> resources)

GroovyContext

public GroovyContext(groovy.lang.GroovyClassLoader classLoader,
                     GroovyResourceFinder resourceFinder)

GroovyContext

public GroovyContext(groovy.lang.GroovyClassLoader classLoader,
                     List<String> resources)
Method Detail

getInstances

public List<Object> getInstances()

getInstanceOfType

public <T> T getInstanceOfType(Class<T> type)

newInstance

public Object newInstance(String resource)
Creates an object instance from the Groovy resource

Parameters:
resource - the Groovy resource to parse
Returns:
An Object instance

newInstance

public Object newInstance(Class<?> parsedClass)
                   throws Exception
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


Copyright © 2003-2012. All Rights Reserved.