Code example for AbstractSingleBeanDefinitionParser

0
import org.w3c.dom.Element;
 
/** 
 * @author Ryan Heaton 
 */ 
public class TokenServiceBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
 
  @Override 
  protected Class getBeanClass(Element element) {
    return InMemoryProviderTokenServices.class; 
  } 
 
  @Override 
  protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
    String cleanup = element.getAttribute("cleanupInterval");
    if (StringUtils.hasText(cleanup)) {
      try { 
        builder.addPropertyValue("cleanupIntervalSeconds", Integer.parseInt(cleanup));
      } 
      catch (NumberFormatException e) {
Experience pair programming with AI  Get Codota for Java