Class NodeTypeDefDiff
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeDefDiff
-
public class NodeTypeDefDiff extends Object
ANodeTypeDefDiff
represents the result of the comparison of two node type definitions.The result of the comparison can be categorized as one of the following types:
NONE
indicates that there is no modification at all.A
TRIVIAL
modification has no impact on the consistency of existing content. The following modifications are consideredTRIVIAL
:- changing node type
orderableChildNodes
flag - changing node type
primaryItemName
value - adding non-
mandatory
property/child node - changing property/child node
protected
flag - changing property/child node
onParentVersion
value - changing property/child node
mandatory
flag tofalse
- changing property/child node
autoCreated
flag - changing specific property/child node
name
to*
- changing child node
defaultPrimaryType
- changing child node
sameNameSiblings
flag totrue
- weaken child node
requiredPrimaryTypes
(e.g. by removing) - weaken property
valueConstraints
(e.g. by removing a constraint or by making a specific constraint less restrictive) - changing property
defaultValues
- changing specific property
requiredType
toundefined
- changing property
multiple
flag totrue
A
MAJOR
modification potentially affects the consistency of existing content. All modifications that are notTRIVIAL
are consideredMAJOR
.This class duplicates code from org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff; both should be updated in sync, see OAK-2802
- changing node type
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
NodeTypeDefDiff.ChildNodeDefDiff
class
NodeTypeDefDiff.PropDefDiff
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
abstractFlagDiff()
static NodeTypeDefDiff
create(NodeTypeDefinition oldDef, NodeTypeDefinition newDef)
int
getType()
Returns the type of modification as expressed by the following constants:NONE
: no modification at allTRIVIAL
: does not affect consistency of existing contentMAJOR
: does affect consistency of existing contentboolean
isMajor()
boolean
isModified()
boolean
isTrivial()
int
mixinFlagDiff()
int
supertypesDiff()
String
toString()
-
-
-
Field Detail
-
NONE
public static final int NONE
no modification- See Also:
- Constant Field Values
-
TRIVIAL
public static final int TRIVIAL
trivial modification: does not affect consistency of existing content- See Also:
- Constant Field Values
-
MAJOR
public static final int MAJOR
major modification: does affect consistency of existing content- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static NodeTypeDefDiff create(NodeTypeDefinition oldDef, NodeTypeDefinition newDef)
- Parameters:
oldDef
- old definitionnewDef
- new definition- Returns:
- the diff
-
isModified
public boolean isModified()
- Returns:
true
if modified
-
isTrivial
public boolean isTrivial()
- Returns:
true
if trivial
-
isMajor
public boolean isMajor()
- Returns:
true
if major
-
getType
public int getType()
Returns the type of modification as expressed by the following constants:NONE
: no modification at allTRIVIAL
: does not affect consistency of existing contentMAJOR
: does affect consistency of existing content
- Returns:
- the type of modification
-
mixinFlagDiff
public int mixinFlagDiff()
- Returns:
true
if mixin flag diff
-
abstractFlagDiff
public int abstractFlagDiff()
- Returns:
true
if abstract flag diff
-
supertypesDiff
public int supertypesDiff()
- Returns:
true
if supertypes diff
-
-