Class EffectiveNodeType

  • public final class EffectiveNodeType
    extends Object
    Effective node type as defined by JCR 2.0, Chapter The order is an implementation detail (compare with JCR 2.0, Chapter 3.7.7) but this implementation replicates the logic from Oak:
    1. local before inherited types
    2. named primary types (even inherited ones) before named mixin types
    3. residual primary types (even inherited ones) before residual mixin types
    4. all named item definitions should be considered first (of both primary and mixins) and only afterwards the unnamed ones
    5. the first potential match wins (even if it is only for the undefined type and more type-specific definitions follow later)
    • Method Detail

      • ofPrimaryTypeAndMixins

        public static @NotNull EffectiveNodeType ofPrimaryTypeAndMixins​(@NotNull
                                                                        @NotNull NodeType primaryType,
                                                                        NodeType... mixinTypes)
      • hashCode

        public int hashCode()
        hashCode in class Object
      • getApplicablePropertyDefinition

        public Optional<PropertyDefinition> getApplicablePropertyDefinition​(@NotNull
                                                                            @NotNull String name,
                                                                            boolean isMultiple,
                                                                            int type)
        Returns the applicable property definition for the given name and type.
        name - the property name (must be the qualified name, not the expanded name)
        isMultiple - true if this is a multi-value type otherwise false
        type - the property value type (one of the constants from PropertyType)
        the applicable property definition
      • getApplicableChildNodeDefinition

        public Optional<NodeDefinition> getApplicableChildNodeDefinition​(@NotNull
                                                                         @NotNull String name,
                                                                         @NotNull NodeType... types)
        Returns the applicable node definition for the given name and types.
        name - the child node name
        types - the node types
        the applicable child node definition
      • getDefaultPrimaryChildNodeTypeName

        public Optional<String> getDefaultPrimaryChildNodeTypeName​(@NotNull
                                                                   @NotNull Node parent,
                                                                   @NotNull String nodeName)
                                                            throws RepositoryException
        parent - the node the parent node for which to figure out the default primary type
        nodeName - the name of the to be created node
        the qualified name of the default primary type for the given intermediate node below parent