private void bindExpressionValue(String mapPropertyName, String dataString, ExecutionContext executionContext, Fragment source) { Map<String, Object> beanMap = executionContext.getBeanContext().getBeanMap(); Map<String, Object> variables = new HashMap<String, Object>(); if(expressionHasDataVariable) { variables.put(EXPRESSION_VALUE_VARIABLE_NAME, dataString); } Object dataObject = expressionEvaluator.exec(beanMap, variables); decodeAndSetPropertyValue(mapPropertyName, dataObject, executionContext, source); }
private void bindSaxDataValue(SAXElement element, ExecutionContext executionContext) { String propertyName; if(mapKeyAttribute != null) { propertyName = SAXUtil.getAttribute(mapKeyAttribute, element.getAttributes(), null); if(propertyName == null) { propertyName = element.getName().getLocalPart(); } } else if(property != null) { propertyName = property; } else { propertyName = element.getName().getLocalPart(); } String dataString = null; if(expressionEvaluator == null || expressionHasDataVariable) { if (isAttribute) { if(valueAttributeNS != null) { dataString = SAXUtil.getAttribute(valueAttributeNS, valueAttributeName, element.getAttributes(), null); } else { dataString = SAXUtil.getAttribute(valueAttributeName, element.getAttributes(), null); } } else { dataString = element.getTextContent(); } } if(expressionEvaluator != null) { bindExpressionValue(propertyName, dataString, executionContext, new Fragment(element)); } else { decodeAndSetPropertyValue(propertyName, dataString, executionContext, new Fragment(element)); } }
private void bindDomDataValue(Element element, ExecutionContext executionContext) { String dataString; if (isAttribute) { if(valueAttributeNS != null) { dataString = DomUtils.getAttributeValue(element, valueAttributeName, valueAttributeNS); } else { dataString = DomUtils.getAttributeValue(element, valueAttributeName); } } else { dataString = DomUtils.getAllText(element, false); } String propertyName; if(mapKeyAttribute != null) { propertyName = DomUtils.getAttributeValue(element, mapKeyAttribute); if(propertyName == null) { propertyName = DomUtils.getName(element); } } else if(property != null) { propertyName = property; } else { propertyName = DomUtils.getName(element); } if(expressionEvaluator != null) { bindExpressionValue(propertyName, dataString, executionContext, new Fragment(element)); } else { decodeAndSetPropertyValue(propertyName, dataString, executionContext, new Fragment(element)); } }