|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xbean.spring.context.v2c.XBeanNamespaceHandler
public class XBeanNamespaceHandler
An enhanced XML parser capable of handling custom XML schemas.
Field Summary | |
---|---|
protected NamedConstructorArgs |
namedConstructorArgs
|
protected static String[] |
RESERVED_BEAN_ATTRIBUTE_NAMES
|
protected static String[] |
RESERVED_ELEMENT_NAMES
All the reserved Spring XML element names which cannot be overloaded by an XML extension |
static String |
SPRING_SCHEMA
|
static String |
SPRING_SCHEMA_COMPAT
|
Constructor Summary | |
---|---|
XBeanNamespaceHandler()
|
Method Summary | |
---|---|
protected void |
addAttributeProperties(org.springframework.beans.factory.config.BeanDefinitionHolder definition,
MappingMetaData metadata,
String className,
Element element)
Parses attribute names and values as being bean property expressions |
protected void |
addAttributeProperty(org.springframework.beans.factory.config.BeanDefinitionHolder definition,
MappingMetaData metadata,
Element element,
Attr attribute)
|
protected void |
addContentProperty(org.springframework.beans.factory.config.BeanDefinitionHolder definition,
MappingMetaData metadata,
Element element)
|
protected void |
addNestedPropertyElements(org.springframework.beans.factory.config.BeanDefinitionHolder definition,
MappingMetaData metadata,
String className,
Element element)
Lets iterate through the children of this element and create any nested child properties |
protected void |
addProperty(org.springframework.beans.factory.config.BeanDefinitionHolder definition,
MappingMetaData metadata,
Element element,
String localName,
String value)
Add a property onto the current BeanDefinition. |
protected void |
addSpringAttributeValues(String className,
Element element)
|
protected void |
addValueToMap(Map map,
Object keyValue,
Object value,
String dups)
|
protected Element |
cloneElement(Element element)
Creates a clone of the element and its attribute (though not its content) |
static void |
configure(org.springframework.context.support.AbstractApplicationContext context,
org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader)
Configures the XmlBeanDefinitionReader to work nicely with extensible XML using this reader implementation. |
protected PropertyEditor |
createPropertyEditor(String propertyEditor)
|
protected void |
declareLifecycleMethods(org.springframework.beans.factory.config.BeanDefinitionHolder definitionHolder,
MappingMetaData metaData,
Element element)
|
org.springframework.beans.factory.config.BeanDefinitionHolder |
decorate(Node node,
org.springframework.beans.factory.config.BeanDefinitionHolder definition,
org.springframework.beans.factory.xml.ParserContext parserContext)
|
protected MappingMetaData |
findNamespaceProperties(String namespaceURI,
String localName)
Uses META-INF/services discovery to find a Properties file with the XML marshaling configuration |
protected String |
getElementText(Element element)
Returns the text of the element |
protected Element |
getFirstChildElement(Element element)
|
protected String |
getLocalName(Element element)
|
protected PropertyDescriptor |
getPropertyDescriptor(String className,
String localName)
Looks up the property decriptor for the given class and property name |
protected Object |
getValue(String value,
String propertyEditor)
|
void |
init()
|
protected boolean |
isCollection(Class type)
Returns true if the given type is a collection type or an array |
protected boolean |
isEmpty(String uri)
|
protected boolean |
isMap(Class type)
|
protected InputStream |
loadResource(String uri)
Loads the resource from the given URI |
org.springframework.beans.factory.config.BeanDefinition |
parse(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext)
|
protected org.springframework.beans.factory.config.BeanDefinitionHolder |
parseBeanFromExtensionElement(Element element)
Parses the non-standard XML element as a Spring bean definition |
protected org.springframework.beans.factory.config.BeanDefinitionHolder |
parseBeanFromExtensionElement(Element element,
String parentClass,
String property)
Parses the non-standard XML element as a Spring bean definition |
protected Object |
parseChildExtensionBean(Element element)
Iterates the children of this element to find the first nested bean |
protected Object |
parseCustomMapElement(MappingMetaData metadata,
Element element,
String name)
|
protected Object |
parseListElement(Element element,
String name)
|
static void |
registerCustomEditors(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
Registers whatever custom editors we need |
protected Class |
resolveBeanClass(org.springframework.beans.factory.support.AbstractBeanDefinition bd,
String beanName)
|
protected Object |
tryParseNestedPropertyViaIntrospection(MappingMetaData metadata,
String className,
Element element)
Attempts to use introspection to parse the nested property element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SPRING_SCHEMA
public static final String SPRING_SCHEMA_COMPAT
protected static final String[] RESERVED_ELEMENT_NAMES
protected static final String[] RESERVED_BEAN_ATTRIBUTE_NAMES
protected final NamedConstructorArgs namedConstructorArgs
Constructor Detail |
---|
public XBeanNamespaceHandler()
Method Detail |
---|
public void init()
init
in interface org.springframework.beans.factory.xml.NamespaceHandler
public org.springframework.beans.factory.config.BeanDefinition parse(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
parse
in interface org.springframework.beans.factory.xml.NamespaceHandler
public org.springframework.beans.factory.config.BeanDefinitionHolder decorate(Node node, org.springframework.beans.factory.config.BeanDefinitionHolder definition, org.springframework.beans.factory.xml.ParserContext parserContext)
decorate
in interface org.springframework.beans.factory.xml.NamespaceHandler
public static void configure(org.springframework.context.support.AbstractApplicationContext context, org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader)
public static void registerCustomEditors(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
protected org.springframework.beans.factory.config.BeanDefinitionHolder parseBeanFromExtensionElement(Element element, String parentClass, String property)
protected Class resolveBeanClass(org.springframework.beans.factory.support.AbstractBeanDefinition bd, String beanName)
protected org.springframework.beans.factory.config.BeanDefinitionHolder parseBeanFromExtensionElement(Element element)
protected void addSpringAttributeValues(String className, Element element)
protected Element cloneElement(Element element)
protected void addAttributeProperties(org.springframework.beans.factory.config.BeanDefinitionHolder definition, MappingMetaData metadata, String className, Element element)
protected void addContentProperty(org.springframework.beans.factory.config.BeanDefinitionHolder definition, MappingMetaData metadata, Element element)
protected void addAttributeProperty(org.springframework.beans.factory.config.BeanDefinitionHolder definition, MappingMetaData metadata, Element element, Attr attribute)
protected void addProperty(org.springframework.beans.factory.config.BeanDefinitionHolder definition, MappingMetaData metadata, Element element, String localName, String value)
protected Object getValue(String value, String propertyEditor)
protected PropertyEditor createPropertyEditor(String propertyEditor)
protected String getLocalName(Element element)
protected void addNestedPropertyElements(org.springframework.beans.factory.config.BeanDefinitionHolder definition, MappingMetaData metadata, String className, Element element)
protected Object tryParseNestedPropertyViaIntrospection(MappingMetaData metadata, String className, Element element)
protected PropertyDescriptor getPropertyDescriptor(String className, String localName)
protected Object parseListElement(Element element, String name)
protected Object parseCustomMapElement(MappingMetaData metadata, Element element, String name)
protected void addValueToMap(Map map, Object keyValue, Object value, String dups)
protected Element getFirstChildElement(Element element)
protected boolean isMap(Class type)
protected boolean isCollection(Class type)
protected Object parseChildExtensionBean(Element element)
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName)
namespaceURI
- the namespace URI of the elementlocalName
- the local name of the element
protected InputStream loadResource(String uri)
protected boolean isEmpty(String uri)
protected void declareLifecycleMethods(org.springframework.beans.factory.config.BeanDefinitionHolder definitionHolder, MappingMetaData metaData, Element element)
protected String getElementText(Element element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |