The Spring Framework

org.springframework.scripting.config
Class ScriptBeanDefinitionParser

java.lang.Object
  extended by org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
      extended by org.springframework.scripting.config.ScriptBeanDefinitionParser
All Implemented Interfaces:
BeanDefinitionParser

 class ScriptBeanDefinitionParser
extends AbstractBeanDefinitionParser

BeanDefinitionParser implementation for the '<lang:groovy/>', '<lang:jruby/>' and '<lang:bsh/>' tags. Allows for objects written using dynamic languages to be easily exposed with the BeanFactory.

The script for each object can be specified either as a reference to the Resource containing it (using the 'script-source' attribute) or inline in the XML configuration itself (using the 'inline-script' attribute.

By default, dynamic objects created with these tags are not refreshable. To enable refreshing, specify the refresh check delay for each object (in milliseconds) using the 'refresh-check-delay' attribute.

Since:
2.0
Author:
Rob Harrop

Field Summary
 
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE
 
Constructor Summary
ScriptBeanDefinitionParser(Class scriptFactoryClass)
          Creates a new instance of this class that creates bean definitions for the supplied ScriptFactory class.
 
Method Summary
protected  AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext)
          Parses the dynamic object element and returns the resulting bean definition.
 
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptBeanDefinitionParser

public ScriptBeanDefinitionParser(Class scriptFactoryClass)
Creates a new instance of this class that creates bean definitions for the supplied ScriptFactory class.

Method Detail

parseInternal

protected AbstractBeanDefinition parseInternal(Element element,
                                               ParserContext parserContext)
Parses the dynamic object element and returns the resulting bean definition. Registers a ScriptFactoryPostProcessor if needed.

Specified by:
parseInternal in class AbstractBeanDefinitionParser
Parameters:
element - the element that is to be parsed into one or more BeanDefinitions
parserContext - the object encapsulating the current state of the parsing process; provides access to a BeanDefinitionRegistry
Returns:
the primary BeanDefinition resulting from the parsing of the supplied Element
See Also:
AbstractBeanDefinitionParser.parse(org.w3c.dom.Element, ParserContext), AbstractBeanDefinitionParser.postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition)

The Spring Framework

Copyright © 2002-2006 The Spring Framework.