Package org.apache.jackrabbit.vault.util
Class EffectiveNodeType
- java.lang.Object
-
- org.apache.jackrabbit.vault.util.EffectiveNodeType
-
public final class EffectiveNodeType extends Object
Effective 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 boolean
equals(Object obj)
Optional<NodeDefinition>
getApplicableChildNodeDefinition(@NotNull String name, @NotNull NodeType... types)
Returns the applicable node definition for the given name and types.Optional<NodeDefinition>
getApplicableChildNodeDefinition(@NotNull Predicate<NodeDefinition> predicate, @NotNull String name)
Optional<PropertyDefinition>
getApplicablePropertyDefinition(@NotNull String name, boolean isMultiple, int type)
Returns the applicable property definition for the given name and type.Optional<PropertyDefinition>
getApplicablePropertyDefinition(Predicate<PropertyDefinition> predicate, @NotNull String name)
Optional<String>
getDefaultPrimaryChildNodeTypeName(@NotNull Node parent, @NotNull String nodeName)
int
hashCode()
static @NotNull EffectiveNodeType
ofNode(@NotNull Node node)
static @NotNull EffectiveNodeType
ofPrimaryTypeAndMixins(@NotNull NodeType primaryType, NodeType... mixinTypes)
String
toString()
-
-
-
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)
-
getApplicablePropertyDefinition
public Optional<PropertyDefinition> getApplicablePropertyDefinition(@NotNull @NotNull 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
-true
if this is a multi-value type otherwisefalse
type
- the property value type (one of the constants fromPropertyType
)- Returns:
- the applicable property definition
-
getApplicablePropertyDefinition
public Optional<PropertyDefinition> getApplicablePropertyDefinition(Predicate<PropertyDefinition> predicate, @NotNull @NotNull String name)
-
getApplicableChildNodeDefinition
public Optional<NodeDefinition> getApplicableChildNodeDefinition(@NotNull @NotNull 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 Optional<NodeDefinition> getApplicableChildNodeDefinition(@NotNull @NotNull Predicate<NodeDefinition> predicate, @NotNull @NotNull String name)
-
getDefaultPrimaryChildNodeTypeName
public Optional<String> getDefaultPrimaryChildNodeTypeName(@NotNull @NotNull Node parent, @NotNull @NotNull 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
-
-