Package org.ldaptive.beans.spring.parser
Class AbstractBeanDefinitionParser
- java.lang.Object
-
- org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
-
- org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
-
- org.ldaptive.beans.spring.parser.AbstractBeanDefinitionParser
-
- All Implemented Interfaces:
org.springframework.beans.factory.xml.BeanDefinitionParser
- Direct Known Subclasses:
AbstractConnectionConfigBeanDefinitionParser
,SearchOperationBeanDefinitionParser
public abstract class AbstractBeanDefinitionParser extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
Common implementation for all bean definition parsers- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
Logger for this class.
-
Constructor Summary
Constructors Constructor Description AbstractBeanDefinitionParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static org.w3c.dom.Element
getDirectChild(org.w3c.dom.Element parent, java.lang.String... names)
Returns the first direct child element of the parent element with a name that matches any of the supplied names.protected static java.lang.Object
parseClassName(java.lang.String name)
Returns an object for the class type with the supplied name.protected static java.time.Duration
parseDuration(java.lang.String value)
Returns aDuration
for the supplied value.protected static java.time.Period
parsePeriod(java.lang.String value)
Returns aPeriod
for the supplied value.protected void
setIfPresent(org.w3c.dom.Element element, java.lang.String attribute, java.lang.String property, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property if the given attribute exists on the element.protected void
setIfPresent(org.w3c.dom.Element element, java.lang.String attribute, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property if the given attribute exists on the element.protected void
setObjectIfPresent(org.w3c.dom.Element element, java.lang.String attribute, java.lang.String property, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property by parsing a class with a default constructor if the given attribute exists on the element.protected void
setObjectIfPresent(org.w3c.dom.Element element, java.lang.String attribute, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property by parsing a class with a default constructor if the given attribute exists on the element.-
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, doParse, getBeanClass, getBeanClassName, getParentName, parseInternal
-
-
-
-
Method Detail
-
parsePeriod
protected static java.time.Period parsePeriod(java.lang.String value)
Returns aPeriod
for the supplied value.- Parameters:
value
- to parse- Returns:
- period
-
parseDuration
protected static java.time.Duration parseDuration(java.lang.String value)
Returns aDuration
for the supplied value.- Parameters:
value
- to parse- Returns:
- duration
-
parseClassName
protected static java.lang.Object parseClassName(java.lang.String name)
Returns an object for the class type with the supplied name. Uses the no-arg constructor.- Parameters:
name
- of the class to instantiate- Returns:
- class type
-
getDirectChild
protected static org.w3c.dom.Element getDirectChild(org.w3c.dom.Element parent, java.lang.String... names)
Returns the first direct child element of the parent element with a name that matches any of the supplied names.- Parameters:
parent
- element to inspectnames
- local names of the element to return- Returns:
- child element or null
-
setIfPresent
protected void setIfPresent(org.w3c.dom.Element element, java.lang.String attribute, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property if the given attribute exists on the element. The property name used is the same as the attribute name.- Parameters:
element
- from which to obtain propertyattribute
- value for obtaining propertybuilder
- to receive property
-
setIfPresent
protected void setIfPresent(org.w3c.dom.Element element, java.lang.String attribute, java.lang.String property, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property if the given attribute exists on the element.- Parameters:
element
- from which to obtain propertyproperty
- to setattribute
- value for obtaining propertybuilder
- to receive property
-
setObjectIfPresent
protected void setObjectIfPresent(org.w3c.dom.Element element, java.lang.String attribute, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property by parsing a class with a default constructor if the given attribute exists on the element.- Parameters:
element
- from which to obtain propertyattribute
- value for obtaining propertybuilder
- to receive property
-
setObjectIfPresent
protected void setObjectIfPresent(org.w3c.dom.Element element, java.lang.String attribute, java.lang.String property, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Sets a property by parsing a class with a default constructor if the given attribute exists on the element.- Parameters:
element
- from which to obtain propertyproperty
- to setattribute
- value for obtaining propertybuilder
- to receive property
-
-