Package org.apache.jackrabbit.vault.util
Class EffectiveNodeType
- java.lang.Object
-
- org.apache.jackrabbit.vault.util.EffectiveNodeType
-
public final class EffectiveNodeType extends java.lang.ObjectEffective node type as defined by JCR 2.0, Chapter 3.7.6.5. The order is an implementation detail (compare with JCR 2.0, Chapter 3.7.7) but this implementation replicates the logic from Oak:- local before inherited types
- named primary types (even inherited ones) before named mixin types
- residual primary types (even inherited ones) before residual mixin types
- all named item definitions should be considered first (of both primary and mixins) and only afterwards the unnamed ones
- the first potential match wins (even if it is only for the undefined type and more type-specific definitions follow later)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.util.Optional<NodeDefinition>getApplicableChildNodeDefinition(@NotNull java.lang.String name, @NotNull NodeType... types)Returns the applicable node definition for the given name and types.java.util.Optional<NodeDefinition>getApplicableChildNodeDefinition(@NotNull java.util.function.Predicate<NodeDefinition> predicate, @NotNull java.lang.String name)java.util.Optional<PropertyDefinition>getApplicablePropertyDefinition(@NotNull java.lang.String name, boolean isMultiple, int type)Returns the applicable property definition for the given name and type.java.util.Optional<PropertyDefinition>getApplicablePropertyDefinition(java.util.function.Predicate<PropertyDefinition> predicate, @NotNull java.lang.String name)java.util.Optional<java.lang.String>getDefaultPrimaryChildNodeTypeName(@NotNull Node parent, @NotNull java.lang.String nodeName)inthashCode()static @NotNull EffectiveNodeTypeofNode(@NotNull Node node)static @NotNull EffectiveNodeTypeofPrimaryTypeAndMixins(@NotNull NodeType primaryType, NodeType... mixinTypes)java.lang.StringtoString()
-
-
-
Method Detail
-
ofNode
@NotNull public static @NotNull EffectiveNodeType ofNode(@NotNull @NotNull Node node) throws RepositoryException
- Throws:
RepositoryException
-
ofPrimaryTypeAndMixins
@NotNull public static @NotNull EffectiveNodeType ofPrimaryTypeAndMixins(@NotNull @NotNull NodeType primaryType, NodeType... mixinTypes)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getApplicablePropertyDefinition
public java.util.Optional<PropertyDefinition> getApplicablePropertyDefinition(@NotNull @NotNull java.lang.String name, boolean isMultiple, int type)
Returns the applicable property definition for the given name and type.- Parameters:
name- the property name (must be the qualified name, not the expanded name)isMultiple-trueif this is a multi-value type otherwisefalsetype- the property value type (one of the constants fromPropertyType)- Returns:
- the applicable property definition
-
getApplicablePropertyDefinition
public java.util.Optional<PropertyDefinition> getApplicablePropertyDefinition(java.util.function.Predicate<PropertyDefinition> predicate, @NotNull @NotNull java.lang.String name)
-
getApplicableChildNodeDefinition
public java.util.Optional<NodeDefinition> getApplicableChildNodeDefinition(@NotNull @NotNull java.lang.String name, @NotNull @NotNull NodeType... types)
Returns the applicable node definition for the given name and types.- Parameters:
name- the child node nametypes- the node types- Returns:
- the applicable child node definition
-
getApplicableChildNodeDefinition
public java.util.Optional<NodeDefinition> getApplicableChildNodeDefinition(@NotNull @NotNull java.util.function.Predicate<NodeDefinition> predicate, @NotNull @NotNull java.lang.String name)
-
getDefaultPrimaryChildNodeTypeName
public java.util.Optional<java.lang.String> getDefaultPrimaryChildNodeTypeName(@NotNull @NotNull Node parent, @NotNull @NotNull java.lang.String nodeName) throws RepositoryException- Parameters:
parent- the node the parent node for which to figure out the default primary typenodeName- the name of the to be created node- Returns:
- the qualified name of the default primary type for the given intermediate node below parent
- Throws:
RepositoryException
-
-