Package org.apache.jackrabbit.oak.json
Class JsopDiff
- java.lang.Object
-
- org.apache.jackrabbit.oak.json.JsopDiff
-
- All Implemented Interfaces:
NodeStateDiff
public class JsopDiff extends java.lang.Object implements NodeStateDiff
TODO document
-
-
Constructor Summary
Constructors Constructor Description JsopDiff()JsopDiff(java.lang.String path, int depth)JsopDiff(BlobSerializer blobs)JsopDiff(BlobSerializer blobs, java.lang.String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanchildNodeAdded(java.lang.String name, NodeState after)Called for all added child nodes.booleanchildNodeChanged(java.lang.String name, NodeState before, NodeState after)Called for all child nodes that may contain changes between the before and after states.booleanchildNodeDeleted(java.lang.String name, NodeState before)Called for all deleted child nodes.static java.lang.StringdiffToJsop(NodeState before, NodeState after)Create the JSOP diff betweenbeforeandafterfor debugging purposes.booleanpropertyAdded(PropertyState after)Called for all added properties.booleanpropertyChanged(PropertyState before, PropertyState after)Called for all changed properties.booleanpropertyDeleted(PropertyState before)Called for all deleted properties.java.lang.StringtoString()
-
-
-
Constructor Detail
-
JsopDiff
public JsopDiff(BlobSerializer blobs, java.lang.String path)
-
JsopDiff
public JsopDiff(BlobSerializer blobs)
-
JsopDiff
public JsopDiff(java.lang.String path, int depth)
-
JsopDiff
public JsopDiff()
-
-
Method Detail
-
diffToJsop
public static java.lang.String diffToJsop(NodeState before, NodeState after)
Create the JSOP diff betweenbeforeandafterfor debugging purposes.This method does not store binaries but returns them inlined in the format
Blob{...}, where the...is implementation-dependent - typically the SHA256 hash of the binary.- Parameters:
before- before node stateafter- after node state- Returns:
- jsop diff between
beforeandafter
-
propertyAdded
public boolean propertyAdded(PropertyState after)
Description copied from interface:NodeStateDiffCalled for all added properties.- Specified by:
propertyAddedin interfaceNodeStateDiff- Parameters:
after- property state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
propertyChanged
public boolean propertyChanged(PropertyState before, PropertyState after)
Description copied from interface:NodeStateDiffCalled for all changed properties. The names of the given two property states are guaranteed to be the same.- Specified by:
propertyChangedin interfaceNodeStateDiff- Parameters:
before- property state before the changeafter- property state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
propertyDeleted
public boolean propertyDeleted(PropertyState before)
Description copied from interface:NodeStateDiffCalled for all deleted properties.- Specified by:
propertyDeletedin interfaceNodeStateDiff- Parameters:
before- property state before the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeAdded
public boolean childNodeAdded(java.lang.String name, NodeState after)Description copied from interface:NodeStateDiffCalled for all added child nodes.- Specified by:
childNodeAddedin interfaceNodeStateDiff- Parameters:
name- name of the added child nodeafter- child node state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeDeleted
public boolean childNodeDeleted(java.lang.String name, NodeState before)Description copied from interface:NodeStateDiffCalled for all deleted child nodes.- Specified by:
childNodeDeletedin interfaceNodeStateDiff- Parameters:
name- name of the deleted child nodebefore- child node state before the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeChanged
public boolean childNodeChanged(java.lang.String name, NodeState before, NodeState after)Description copied from interface:NodeStateDiffCalled for all child nodes that may contain changes between the before and after states. The comparison implementation is expected to make an effort to avoid calling this method on child nodes under which nothing has changed.- Specified by:
childNodeChangedin interfaceNodeStateDiff- Parameters:
name- name of the changed child nodebefore- child node state before the changeafter- child node state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-