org.ldaptive.beans.spring.parser.ConnectionConfigBeanDefinitionParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ldaptive-beans Show documentation
Show all versions of ldaptive-beans Show documentation
Provides a mapping, persistence, and code generation API for reading and writing POJOs to an LDAP directory
/* See LICENSE for licensing and NOTICE for copyright. */
package org.ldaptive.beans.spring.parser;
import org.ldaptive.ConnectionConfig;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;
/**
* Parser for connection-config
elements.
*
* @author Middleware Services
*/
public class ConnectionConfigBeanDefinitionParser extends AbstractConnectionConfigBeanDefinitionParser
{
@Override
protected String resolveId(
final Element element,
// CheckStyle:IllegalTypeCheck OFF
final AbstractBeanDefinition definition,
// CheckStyle:IllegalTypeCheck ON
final ParserContext parserContext)
throws BeanDefinitionStoreException
{
final String idAttrValue = element.getAttribute("id");
return StringUtils.hasText(idAttrValue) ? idAttrValue : "connection-config";
}
@Override
protected Class> getBeanClass(final Element element)
{
return ConnectionConfig.class;
}
@Override
protected void doParse(
final Element element,
final ParserContext context,
final BeanDefinitionBuilder builder)
{
parseConnectionConfig(builder, element, true);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy