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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.slf4j.Logger
    Logger for this class.

    Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

    ID_ATTRIBUTE, NAME_ATTRIBUTE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static Element
    getDirectChild(Element parent, String... names)
    Returns the first direct child element of the parent element with a name that matches any of the supplied names.
    protected static Object
    Returns an object for the class type with the supplied name.
    protected static Duration
    Returns a Duration for the supplied value.
    protected static Period
    Returns a Period for the supplied value.
    protected void
    setIfPresent(Element element, String attribute, String property, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
    Sets a property if the given attribute exists on the element.
    protected void
    setIfPresent(Element element, String attribute, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
    Sets a property if the given attribute exists on the element.
    protected void
    setObjectIfPresent(Element element, String attribute, 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(Element element, 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

    Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

    parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
      Logger for this class.
  • Constructor Details

    • AbstractBeanDefinitionParser

      public AbstractBeanDefinitionParser()
  • Method Details

    • parsePeriod

      protected static Period parsePeriod(String value)
      Returns a Period for the supplied value.
      Parameters:
      value - to parse
      Returns:
      period
    • parseDuration

      protected static Duration parseDuration(String value)
      Returns a Duration for the supplied value.
      Parameters:
      value - to parse
      Returns:
      duration
    • parseClassName

      protected static Object parseClassName(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 Element getDirectChild(Element parent, 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 inspect
      names - local names of the element to return
      Returns:
      child element or null
    • setIfPresent

      protected void setIfPresent(Element element, 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 property
      attribute - value for obtaining property
      builder - to receive property
    • setIfPresent

      protected void setIfPresent(Element element, String attribute, 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 property
      property - to set
      attribute - value for obtaining property
      builder - to receive property
    • setObjectIfPresent

      protected void setObjectIfPresent(Element element, 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 property
      attribute - value for obtaining property
      builder - to receive property
    • setObjectIfPresent

      protected void setObjectIfPresent(Element element, String attribute, 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 property
      property - to set
      attribute - value for obtaining property
      builder - to receive property