Class SchemaLocationNodeValueMerge
java.lang.Object
org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
org.broadleafcommerce.common.extensibility.context.merge.handlers.NodeValueMerge
org.broadleafcommerce.common.extensibility.context.merge.handlers.SpaceDelimitedNodeValueMerge
org.broadleafcommerce.common.extensibility.context.merge.handlers.SchemaLocationNodeValueMerge
- All Implemented Interfaces:
Comparable<Object>,MergeHandler
Designed to specifically handle the merge of schemaLocation references. This takes any of the Spring XSD references for particular Spring versions and replaces them with XSDs without a version reference. This allows the final XSD reference to refer to the latest version of Spring, and reduces the need for modules to be updated with every Spring update.
This will also prevents multiple XSD references that cause parse exceptions when the final XML file is presented to Spring
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.NodeValueMerge
delimiter, regexFields inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
children, name, priority, xpath -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMergedNodeValues(Node node1, Node node2) protected StringgetSanitizedValue(String attributeValue) Sanitizes the given attribute value by stripping out the version number for the Spring XSDs.Methods inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.SpaceDelimitedNodeValueMerge
getDelimiterMethods inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.NodeValueMerge
getRegEx, mergeMethods inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
compareTo, getChildren, getName, getPriority, getXPath, setChildren, setName, setPriority, setXPath
-
Constructor Details
-
SchemaLocationNodeValueMerge
public SchemaLocationNodeValueMerge()
-
-
Method Details
-
getMergedNodeValues
- Overrides:
getMergedNodeValuesin classNodeValueMerge
-
getSanitizedValue
Sanitizes the given attribute value by stripping out the version number for the Spring XSDs.
For example, given http://www.springframework.org/schema/beans/spring-beans-4.1.xsd this will return http://www.springframework.org/schema/beans/spring-beans.xsd
- Parameters:
attributeValue- the value of an xsi:schemaLocation attribute- Returns:
- the given string with all of the Spring XSD version numbers stripped out.
-