|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.beans.factory.xml.AbstractBeanDefinitionParser
org.springframework.scripting.config.ScriptBeanDefinitionParser
class ScriptBeanDefinitionParser
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.
| Field Summary | |
|---|---|
private static java.lang.String |
AUTOWIRE_ATTRIBUTE
|
private static java.lang.String |
CUSTOMIZER_REF_ATTRIBUTE
|
private static java.lang.String |
DEPENDENCY_CHECK_ATTRIBUTE
|
private static java.lang.String |
DESTROY_METHOD_ATTRIBUTE
|
private static java.lang.String |
INIT_METHOD_ATTRIBUTE
|
private static java.lang.String |
INLINE_SCRIPT_ELEMENT
|
private static java.lang.String |
REFRESH_CHECK_DELAY_ATTRIBUTE
|
private static java.lang.String |
SCOPE_ATTRIBUTE
|
private static java.lang.String |
SCRIPT_INTERFACES_ATTRIBUTE
|
private static java.lang.String |
SCRIPT_SOURCE_ATTRIBUTE
|
private java.lang.String |
scriptFactoryClassName
The ScriptFactory class that this
parser instance will create bean definitions for. |
| Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser |
|---|
ID_ATTRIBUTE, NAME_ATTRIBUTE |
| Constructor Summary | |
|---|---|
ScriptBeanDefinitionParser(java.lang.String scriptFactoryClassName)
Create a new instance of this parser, creating bean definitions for the supplied ScriptFactory class. |
|
| Method Summary | |
|---|---|
protected AbstractBeanDefinition |
parseInternal(org.w3c.dom.Element element,
ParserContext parserContext)
Parses the dynamic object element and returns the resulting bean definition. |
private java.lang.String |
resolveScriptSource(org.w3c.dom.Element element,
XmlReaderContext readerContext)
Resolves the script source from either the ' script-source' attribute or
the 'inline-script' element. |
protected boolean |
shouldGenerateIdAsFallback()
Scripted beans may be anonymous as well. |
| 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 |
| Field Detail |
|---|
private static final java.lang.String SCRIPT_SOURCE_ATTRIBUTE
private static final java.lang.String INLINE_SCRIPT_ELEMENT
private static final java.lang.String SCOPE_ATTRIBUTE
private static final java.lang.String AUTOWIRE_ATTRIBUTE
private static final java.lang.String DEPENDENCY_CHECK_ATTRIBUTE
private static final java.lang.String INIT_METHOD_ATTRIBUTE
private static final java.lang.String DESTROY_METHOD_ATTRIBUTE
private static final java.lang.String SCRIPT_INTERFACES_ATTRIBUTE
private static final java.lang.String REFRESH_CHECK_DELAY_ATTRIBUTE
private static final java.lang.String CUSTOMIZER_REF_ATTRIBUTE
private final java.lang.String scriptFactoryClassName
ScriptFactory class that this
parser instance will create bean definitions for.
| Constructor Detail |
|---|
public ScriptBeanDefinitionParser(java.lang.String scriptFactoryClassName)
ScriptFactory class.
scriptFactoryClassName - the ScriptFactory class to operate on| Method Detail |
|---|
protected AbstractBeanDefinition parseInternal(org.w3c.dom.Element element,
ParserContext parserContext)
ScriptFactoryPostProcessor if needed.
parseInternal in class AbstractBeanDefinitionParserelement - the element that is to be parsed into one or more BeanDefinitionsparserContext - the object encapsulating the current state of the parsing process;
provides access to a BeanDefinitionRegistry
BeanDefinition resulting from the parsing of the supplied ElementAbstractBeanDefinitionParser.parse(org.w3c.dom.Element, ParserContext),
AbstractBeanDefinitionParser.postProcessComponentDefinition(org.springframework.beans.factory.parsing.BeanComponentDefinition)
private java.lang.String resolveScriptSource(org.w3c.dom.Element element,
XmlReaderContext readerContext)
script-source' attribute or
the 'inline-script' element. Logs and ReaderContext.error(java.lang.String, java.lang.Object) and
returns null if neither or both of these values are specified.
protected boolean shouldGenerateIdAsFallback()
shouldGenerateIdAsFallback in class AbstractBeanDefinitionParser
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||