Interface MergeHandler
- All Known Implementing Classes:
AttributePreserveInsert,BaseHandler,CommaDelimitedNodeValueMerge,InsertChildrenOf,InsertItems,LiberalNodeReplaceInsert,MergeHandlerAdapter,MetadataOverrideNodeReplaceInsert,NodeReplace,NodeReplaceInsert,NodeValueMerge,NonEmptyNodeReplaceInsert,SchemaLocationNodeValueMerge,SpaceDelimitedNodeValueMerge
public interface MergeHandler
All handlers must implement the MergeHandler interface. It defines
the key properties and actions a MergeHandler must perform. MergeHandlers
perform the actual merge of data from the patch document to the source
document based on the business rules of the implementation.
- Author:
- jfischer
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve any child merge handlers associated with this handler.getName()Retrieve the name associated with this merge handlers.intRetrieve the priority for the handler.getXPath()Retrieve the XPath query associated with this handler.Node[]Perform the merge using the supplied list of nodes from the source and patch documents, respectively.voidsetChildren(MergeHandler[] children) Set the child merge handlersvoidSet the period-delimited numeric string that names this handlervoidsetPriority(int priority) Set the priority for this handlervoidSet the xpath query
-
Method Details
-
merge
Perform the merge using the supplied list of nodes from the source and patch documents, respectively. Also, a list of nodes that have already been merged is provided and may be used by the implementation when necessary.- Parameters:
nodeList1- list of nodes to be merged from the source documentnodeList2- list of nodes to be merged form the patch documentexhaustedNodes- already merged nodes- Returns:
- list of merged nodes
-
getPriority
int getPriority()Retrieve the priority for the handler. Priorities are used by the MergeManager to establish the order of operations for performing merges.- Returns:
- the priority value
-
setPriority
void setPriority(int priority) Set the priority for this handler- Parameters:
priority-
-
getXPath
String getXPath()Retrieve the XPath query associated with this handler. XPath is used by the handler to define to section of the source and patch documents that will be merged.- Returns:
- the xpath query
-
setXPath
Set the xpath query- Parameters:
xpath-
-
getChildren
MergeHandler[] getChildren()Retrieve any child merge handlers associated with this handler. Child merge handlers may be added alter merge behavior for a subsection of the merge area defined by this merge handler.- Returns:
- child merge handlers
-
setChildren
Set the child merge handlers- Parameters:
children-
-
getName
String getName()Retrieve the name associated with this merge handlers. Merge handler names are period-delimited numeric strings that define the hierarchical relationship of mergehandlers and their children. For example, "2" could be used to define the second handler in the configuration list and "2.1" would be the name describing the first child handler of "2".- Returns:
- the period-delimited numeric string that names this handler
-
setName
Set the period-delimited numeric string that names this handler- Parameters:
name-
-