Nuxeo ECM Projects 5.6-RC1

org.nuxeo.ecm.diff.service.impl
Class FieldDiffHelper

java.lang.Object
  extended by org.nuxeo.ecm.diff.service.impl.FieldDiffHelper

public final class FieldDiffHelper
extends Object

Helper for computing a field diff.

Since:
5.6
Author:
Antoine Taillefer

Field Summary
static String FACET_ELEMENT
           
static String NAME_ATTRIBUTE
           
static String SCHEMA_ELEMENT
           
static String TYPE_ATTRIBUTE
           
 
Constructor Summary
FieldDiffHelper()
           
 
Method Summary
static PropertyDiff applyPropertyHierarchyToDiff(PropertyDiff firstPropertyDiff, List<PropertyHierarchyNode> propertyHierarchy)
          Sets the property diff hierarchy.
static boolean computeFieldDiff(DocumentDiff docDiff, org.custommonkey.xmlunit.NodeDetail controlNodeDetail, org.custommonkey.xmlunit.NodeDetail testNodeDetail, int fieldDifferenceCount, org.custommonkey.xmlunit.Difference difference)
          Computes a field diff.
static String getPropertyType(Node node)
          Gets the node property type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACET_ELEMENT

public static final String FACET_ELEMENT
See Also:
Constant Field Values

SCHEMA_ELEMENT

public static final String SCHEMA_ELEMENT
See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final String TYPE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

FieldDiffHelper

public FieldDiffHelper()
Method Detail

computeFieldDiff

public static boolean computeFieldDiff(DocumentDiff docDiff,
                                       org.custommonkey.xmlunit.NodeDetail controlNodeDetail,
                                       org.custommonkey.xmlunit.NodeDetail testNodeDetail,
                                       int fieldDifferenceCount,
                                       org.custommonkey.xmlunit.Difference difference)
                                throws ClientException
Computes a field diff.

First gets all needed elements to compute the field diff:

Parameters:
docDiff - the doc diff
controlNodeDetail - the control node detail
testNodeDetail - the test node detail
fieldDifferenceCount - the field difference countadd
difference - the difference
Returns:
true if a field diff has been found
Throws:
ClientException - the client exception

getPropertyType

public static String getPropertyType(Node node)
Gets the node property type.

Parameters:
node - the node
Returns:
the property diff type

applyPropertyHierarchyToDiff

public static PropertyDiff applyPropertyHierarchyToDiff(PropertyDiff firstPropertyDiff,
                                                        List<PropertyHierarchyNode> propertyHierarchy)
                                                 throws ClientException
Sets the property diff hierarchy.

Parameters:
firstPropertyDiff - the first property diff
propertyHierarchy - the property hierarchy
Returns:
the property diff
Throws:
ClientException - the client exception

Nuxeo ECM Projects 5.6-RC1

Copyright © 2012 Nuxeo SA. All Rights Reserved.