Source:
<code>protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String channelName = element.getAttribute(CHANNEL_ATTRIBUTE); if (!StringUtils.hasText(channelName)) { channelName = IntegrationNamespaceUtils.createDirectChannel(element, parserContext); } if (!StringUtils.hasText(element.getAttribute(CACHE_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + CACHE_ATTRIBUTE + "' attribute is required.", element); } else if (!StringUtils.hasText(element.getAttribute(CACHE_EVENTS_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + CACHE_EVENTS_ATTRIBUTE + "' attribute is required.", element); } else if (!StringUtils.hasText(element.getAttribute(PREDICATE_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + PREDICATE_ATTRIBUTE + "' attribute is required.", element); } <START> Assert.isTrue(HazelcastIntegrationDefinitionValidator.validateEnumType(CacheEventType.class, element.getAttribute(CACHE_EVENTS_ATTRIBUTE))); <END> builder.addPropertyReference(OUTPUT_CHANNEL, channelName); builder.addConstructorArgReference(element.getAttribute(CACHE_ATTRIBUTE)); builder.addConstructorArgValue(element.getAttribute(PREDICATE_ATTRIBUTE)); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, CACHE_EVENTS_ATTRIBUTE, CACHE_EVENT_TYPES); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IntegrationNamespaceUtils.AUTO_STARTUP); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IntegrationNamespaceUtils.PHASE); }</code><technical_language>do this Parser. attribute property-placeholder SpEL. validation default CacheEventType.valueOf() setter is enough. If end-user provides a bad end exception. rely Spring's ConversionService magic</technical_language>

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String channelName = element.getAttribute(CHANNEL_ATTRIBUTE); if (!StringUtils.hasText(channelName)) { channelName = IntegrationNamespaceUtils.createDirectChannel(element, parserContext); } if (!StringUtils.hasText(element.getAttribute(CACHE_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + CACHE_ATTRIBUTE + "' attribute is required.", element); } else if (!StringUtils.hasText(element.getAttribute(CACHE_EVENTS_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + CACHE_EVENTS_ATTRIBUTE + "' attribute is required.", element); } else if (!StringUtils.hasText(element.getAttribute(PREDICATE_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + PREDICATE_ATTRIBUTE + "' attribute is required.", element); } else if (!StringUtils.hasText(element.getAttribute(CACHE_LISTENING_POLICY_ATTRIBUTE))) { parserContext.getReaderContext().error("'" + CACHE_LISTENING_POLICY_ATTRIBUTE + "' attribute is required.", element); } builder.addPropertyReference(OUTPUT_CHANNEL, channelName); builder.addConstructorArgReference(element.getAttribute(CACHE_ATTRIBUTE)); builder.addConstructorArgValue(element.getAttribute(PREDICATE_ATTRIBUTE)); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, CACHE_EVENTS_ATTRIBUTE, CACHE_EVENT_TYPES); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, INCLUDE_VALUE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, CACHE_LISTENING_POLICY_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IntegrationNamespaceUtils.AUTO_STARTUP); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IntegrationNamespaceUtils.PHASE); }