/** * Set the preconfigured event properties resolved by XPath expression. * * @param explicitXPathProperties are preconfigured event properties * @param additionalSchemaProperties the explicit properties */ protected void initialize( Collection<ConfigurationEventTypeXMLDOM.XPathPropertyDesc> explicitXPathProperties, List<ExplicitPropertyDescriptor> additionalSchemaProperties) { // make sure we override those explicitly provided with those derived from a metadataz Map<String, ExplicitPropertyDescriptor> namedProperties = new LinkedHashMap<String, ExplicitPropertyDescriptor>(); for (ExplicitPropertyDescriptor desc : additionalSchemaProperties) { namedProperties.put(desc.getDescriptor().getPropertyName(), desc); } String xpathExpression = null; try { for (ConfigurationEventTypeXMLDOM.XPathPropertyDesc property : explicitXPathProperties) { XPath xPath = xPathFactory.newXPath(); if (namespaceContext != null) { xPath.setNamespaceContext(namespaceContext); } xpathExpression = property.getXpath(); if (log.isInfoEnabled()) { log.info( "Compiling XPath expression for property '" + property.getName() + "' as '" + xpathExpression + "'"); } XPathExpression expression = xPath.compile(xpathExpression); FragmentFactoryXPathPredefinedGetter fragmentFactory = null; boolean isFragment = false; if (property.getOptionaleventTypeName() != null) { fragmentFactory = new FragmentFactoryXPathPredefinedGetter( this.getEventAdapterService(), property.getOptionaleventTypeName(), property.getName()); isFragment = true; } boolean isArray = false; if (property.getType().equals(XPathConstants.NODESET)) { isArray = true; } EventPropertyGetter getter = new XPathPropertyGetter( property.getName(), xpathExpression, expression, property.getType(), property.getOptionalCastToType(), fragmentFactory); Class returnType = SchemaUtil.toReturnType(property.getType(), property.getOptionalCastToType()); EventPropertyDescriptor desc = new EventPropertyDescriptor( property.getName(), returnType, null, false, false, isArray, false, isFragment); ExplicitPropertyDescriptor explicit = new ExplicitPropertyDescriptor( desc, getter, isArray, property.getOptionaleventTypeName()); namedProperties.put(desc.getPropertyName(), explicit); } } catch (XPathExpressionException ex) { throw new EPException( "XPath expression could not be compiled for expression '" + xpathExpression + '\'', ex); } super.initialize(new ArrayList<ExplicitPropertyDescriptor>(namedProperties.values())); // evaluate start and end timestamp properties if any startTimestampPropertyName = configurationEventTypeXMLDOM.getStartTimestampPropertyName(); endTimestampPropertyName = configurationEventTypeXMLDOM.getEndTimestampPropertyName(); EventTypeUtility.validateTimestampProperties( this, startTimestampPropertyName, endTimestampPropertyName); }