Code example for AbstractSingleBeanDefinitionParser

0
 * BeanDefinitionParser for the jpa-repository elements in a Spring context. 
 * 
 * @author Allard Buijze 
 * @since 2.0 
 */ 
public class JpaRepositoryBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
 
    private static final String ENTITY_MANAGER_PROVIDER = "entity-manager-provider";
    private static final String EVENT_BUS = "event-bus";
    private static final String EVENT_STORE = "event-store";
    private static final String LOCK_MANAGER = "lock-manager";
    private static final String LOCKING_STRATEGY = "locking-strategy";
    private static final String AGGREGATE_TYPE = "aggregate-type";
 
    @Override 
    protected Class<?> getBeanClass(Element element) {
        if (element.hasAttribute(EVENT_STORE)) {
            return HybridJpaRepository.class; 
        } 
        return GenericJpaRepository.class;