ch.elca.el4j.services.xmlmerge.factory
Class DiffOperationFactory

java.lang.Object
  extended by ch.elca.el4j.services.xmlmerge.factory.DiffOperationFactory
All Implemented Interfaces:
OperationFactory

public class DiffOperationFactory
extends Object
implements OperationFactory

An operation factory delegating to other operation factories according to the existence of the original and patch element.

Author:
Laurent Bovet (LBO), Alex Mathey (AMA)
File-location:
DiffOperationFactory
Last check-in date:
2009-08-04 14:25:40 +0200 (Di, 04. Aug 2009) by swismer for revision 3874

Constructor Summary
DiffOperationFactory()
           
 
Method Summary
 Operation getOperation(org.jdom.Element originalElement, org.jdom.Element patchElement)
          Creates operation (action, mapper and matcher) instances corresponding to a pair of elements from the original and patch DOMs.
 void setInBothOperationFactory(OperationFactory inBothOperationFactory)
          Sets the operation factory this factory delegates to if the original and patch elements exist.
 void setOnlyInOriginalOperationFactory(OperationFactory onlyInOriginalOperationFactory)
          Sets the operation factory this factory delegates to if only the original element exists.
 void setOnlyInPatchOperationFactory(OperationFactory onlyInPatchOperationFactory)
          Sets the operation factory this factory delegates to if only the patch element exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiffOperationFactory

public DiffOperationFactory()
Method Detail

setInBothOperationFactory

public void setInBothOperationFactory(OperationFactory inBothOperationFactory)
Sets the operation factory this factory delegates to if the original and patch elements exist.

Parameters:
inBothOperationFactory - the operation factory this factory delegates to if the original and patch elements exist.

setOnlyInOriginalOperationFactory

public void setOnlyInOriginalOperationFactory(OperationFactory onlyInOriginalOperationFactory)
Sets the operation factory this factory delegates to if only the original element exists.

Parameters:
onlyInOriginalOperationFactory - factory this factory delegates to if only the original element exists

setOnlyInPatchOperationFactory

public void setOnlyInPatchOperationFactory(OperationFactory onlyInPatchOperationFactory)
Sets the operation factory this factory delegates to if only the patch element exists.

Parameters:
onlyInPatchOperationFactory - factory this factory delegates to if only the patch element exists

getOperation

public Operation getOperation(org.jdom.Element originalElement,
                              org.jdom.Element patchElement)
                       throws AbstractXmlMergeException
Creates operation (action, mapper and matcher) instances corresponding to a pair of elements from the original and patch DOMs.

Specified by:
getOperation in interface OperationFactory
Parameters:
originalElement - Original element
patchElement - Modified element
Returns:
The operation (action, mapper or matcher) for the given element pair
Throws:
AbstractXmlMergeException - If an error occurs during operation creation


Copyright © 2005-2011 ELCA. All Rights Reserved.