Class NodeTypeDefDiff
java.lang.Object
org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeDefDiff
A
NodeTypeDefDiff 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 considered
TRIVIAL:
- changing node type
orderableChildNodesflag - changing node type
primaryItemNamevalue - adding non-
mandatoryproperty/child node - changing property/child node
protectedflag - changing property/child node
onParentVersionvalue - changing property/child node
mandatoryflag tofalse - changing property/child node
autoCreatedflag - changing specific property/child node
nameto* - changing child node
defaultPrimaryType - changing child node
sameNameSiblingsflag 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
requiredTypetoundefined - changing property
multipleflag totrue
A MAJOR modification potentially affects the
consistency of existing content.
All modifications that are not TRIVIAL are considered
MAJOR.
This class duplicates code from org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff; both should be updated in sync, see OAK-2802
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintstatic NodeTypeDefDiffcreate(NodeTypeDefinition oldDef, NodeTypeDefinition newDef) intgetType()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 contentbooleanisMajor()booleanbooleanintinttoString()
-
Field Details
-
NONE
public static final int NONEno modification- See Also:
-
TRIVIAL
public static final int TRIVIALtrivial modification: does not affect consistency of existing content- See Also:
-
MAJOR
public static final int MAJORmajor modification: does affect consistency of existing content- See Also:
-
-
Method Details
-
create
- Parameters:
oldDef- old definitionnewDef- new definition- Returns:
- the diff
-
isModified
public boolean isModified()- Returns:
trueif modified
-
isTrivial
public boolean isTrivial()- Returns:
trueif trivial
-
isMajor
public boolean isMajor()- Returns:
trueif 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:
trueif mixin flag diff
-
abstractFlagDiff
public int abstractFlagDiff()- Returns:
trueif abstract flag diff
-
supertypesDiff
public int supertypesDiff()- Returns:
trueif supertypes diff
-
toString
-