Class ReadOnlyNodeTypeManager

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.jcr.nodetype.NodeDefinitionTemplate createNodeDefinitionTemplate()  
      javax.jcr.nodetype.NodeTypeTemplate createNodeTypeTemplate()  
      javax.jcr.nodetype.NodeTypeTemplate createNodeTypeTemplate​(javax.jcr.nodetype.NodeTypeDefinition ntd)  
      javax.jcr.nodetype.PropertyDefinitionTemplate createPropertyDefinitionTemplate()  
      javax.jcr.nodetype.NodeTypeIterator getAllNodeTypes()  
      @NotNull javax.jcr.nodetype.NodeDefinition getDefinition​(@NotNull Tree parent, @NotNull java.lang.String nodeName)
      Returns the node definition for a child node of parent named nodeName with a default primary type.
      @NotNull javax.jcr.nodetype.PropertyDefinition getDefinition​(@NotNull Tree parent, @NotNull PropertyState property, boolean exactTypeMatch)
      Calculates the applicable definition for the property state under the given parent tree.
      @NotNull javax.jcr.nodetype.NodeDefinition getDefinition​(@NotNull Tree parent, @NotNull Tree targetNode)
      Calculates the applicable definition for the child node under the given parent node.
      @NotNull EffectiveNodeType getEffectiveNodeType​(@NotNull javax.jcr.Node node)
      Returns all the node types of the given node, in a breadth-first traversal order of the type hierarchy.
      @NotNull EffectiveNodeType getEffectiveNodeType​(@NotNull Tree tree)
      Calculates and returns the effective node types of the given tree.
      static @NotNull ReadOnlyNodeTypeManager getInstance​(Root root, NamePathMapper namePathMapper)
      Return a new instance of ReadOnlyNodeTypeManager that reads node type information from the tree at NodeTypeConstants.NODE_TYPES_PATH.
      javax.jcr.nodetype.NodeTypeIterator getMixinNodeTypes()  
      javax.jcr.nodetype.NodeType getNodeType​(java.lang.String name)  
      javax.jcr.nodetype.NodeTypeIterator getPrimaryNodeTypes()  
      @NotNull javax.jcr.nodetype.NodeDefinition getRootDefinition()  
      boolean hasNodeType​(java.lang.String name)  
      boolean isNodeType​(@NotNull java.lang.String typeName, @NotNull java.lang.String superName)
      Returns true if typeName is of the specified primary node type or mixin type, or a subtype thereof.
      boolean isNodeType​(@NotNull Tree tree, @NotNull java.lang.String oakNtName)
      Returns true if this tree is of the specified primary node type or mixin type, or a subtype thereof respecting the effective node type of the tree.
      boolean isNodeType​(@Nullable java.lang.String primaryTypeName, @NotNull java.util.function.Supplier<java.lang.Iterable<java.lang.String>> mixinTypes, @NotNull java.lang.String nodeTypeName)
      Returns true if typeName is of the specified primary node type or mixin type, or a subtype thereof.
      javax.jcr.nodetype.NodeType registerNodeType​(javax.jcr.nodetype.NodeTypeDefinition ntd, boolean allowUpdate)
      This implementation always throws a UnsupportedRepositoryOperationException.
      javax.jcr.nodetype.NodeTypeIterator registerNodeTypes​(javax.jcr.nodetype.NodeTypeDefinition[] ntds, boolean allowUpdate)
      This implementation always throws a UnsupportedRepositoryOperationException.
      void unregisterNodeType​(java.lang.String name)
      This implementation always throws a UnsupportedRepositoryOperationException.
      void unregisterNodeTypes​(java.lang.String[] names)
      This implementation always throws a UnsupportedRepositoryOperationException.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReadOnlyNodeTypeManager

        public ReadOnlyNodeTypeManager()
    • Method Detail

      • getInstance

        @NotNull
        public static @NotNull ReadOnlyNodeTypeManager getInstance​(Root root,
                                                                   NamePathMapper namePathMapper)
        Return a new instance of ReadOnlyNodeTypeManager that reads node type information from the tree at NodeTypeConstants.NODE_TYPES_PATH.
        Parameters:
        root - The root to read node types from.
        namePathMapper - The NamePathMapper to use.
        Returns:
        a new instance of ReadOnlyNodeTypeManager.
      • hasNodeType

        public boolean hasNodeType​(java.lang.String name)
                            throws javax.jcr.RepositoryException
        Specified by:
        hasNodeType in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • getNodeType

        public javax.jcr.nodetype.NodeType getNodeType​(java.lang.String name)
                                                throws javax.jcr.RepositoryException
        Specified by:
        getNodeType in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • getAllNodeTypes

        public javax.jcr.nodetype.NodeTypeIterator getAllNodeTypes()
                                                            throws javax.jcr.RepositoryException
        Specified by:
        getAllNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • getPrimaryNodeTypes

        public javax.jcr.nodetype.NodeTypeIterator getPrimaryNodeTypes()
                                                                throws javax.jcr.RepositoryException
        Specified by:
        getPrimaryNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • getMixinNodeTypes

        public javax.jcr.nodetype.NodeTypeIterator getMixinNodeTypes()
                                                              throws javax.jcr.RepositoryException
        Specified by:
        getMixinNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • createNodeTypeTemplate

        public javax.jcr.nodetype.NodeTypeTemplate createNodeTypeTemplate()
                                                                   throws javax.jcr.RepositoryException
        Specified by:
        createNodeTypeTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • createNodeTypeTemplate

        public javax.jcr.nodetype.NodeTypeTemplate createNodeTypeTemplate​(javax.jcr.nodetype.NodeTypeDefinition ntd)
                                                                   throws javax.jcr.RepositoryException
        Specified by:
        createNodeTypeTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • createNodeDefinitionTemplate

        public javax.jcr.nodetype.NodeDefinitionTemplate createNodeDefinitionTemplate()
                                                                               throws javax.jcr.RepositoryException
        Specified by:
        createNodeDefinitionTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • createPropertyDefinitionTemplate

        public javax.jcr.nodetype.PropertyDefinitionTemplate createPropertyDefinitionTemplate()
                                                                                       throws javax.jcr.RepositoryException
        Specified by:
        createPropertyDefinitionTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • registerNodeType

        public javax.jcr.nodetype.NodeType registerNodeType​(javax.jcr.nodetype.NodeTypeDefinition ntd,
                                                            boolean allowUpdate)
                                                     throws javax.jcr.RepositoryException
        This implementation always throws a UnsupportedRepositoryOperationException.
        Specified by:
        registerNodeType in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • registerNodeTypes

        public javax.jcr.nodetype.NodeTypeIterator registerNodeTypes​(javax.jcr.nodetype.NodeTypeDefinition[] ntds,
                                                                     boolean allowUpdate)
                                                              throws javax.jcr.RepositoryException
        This implementation always throws a UnsupportedRepositoryOperationException.
        Specified by:
        registerNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • unregisterNodeType

        public void unregisterNodeType​(java.lang.String name)
                                throws javax.jcr.RepositoryException
        This implementation always throws a UnsupportedRepositoryOperationException.
        Specified by:
        unregisterNodeType in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • unregisterNodeTypes

        public void unregisterNodeTypes​(java.lang.String[] names)
                                 throws javax.jcr.RepositoryException
        This implementation always throws a UnsupportedRepositoryOperationException.
        Specified by:
        unregisterNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Throws:
        javax.jcr.RepositoryException
      • isNodeType

        public boolean isNodeType​(@NotNull
                                  @NotNull Tree tree,
                                  @NotNull
                                  @NotNull java.lang.String oakNtName)
        Description copied from interface: EffectiveNodeTypeProvider
        Returns true if this tree is of the specified primary node type or mixin type, or a subtype thereof respecting the effective node type of the tree. Returns false otherwise. Note: caution must be taken while calling this api because it doesn't offer the same strict guarantees as the Node#isNodeType(String) method in the case where the session doesn't have access to the jcr:mixinTypes property.
        Specified by:
        isNodeType in interface EffectiveNodeTypeProvider
        Parameters:
        tree - The tree to be tested.
        oakNtName - The internal oak name of the node type to be tested.
        Returns:
        true if the specified node is of the given node type.
      • isNodeType

        public boolean isNodeType​(@Nullable
                                  @Nullable java.lang.String primaryTypeName,
                                  @NotNull
                                  @NotNull java.util.function.Supplier<java.lang.Iterable<java.lang.String>> mixinTypes,
                                  @NotNull
                                  @NotNull java.lang.String nodeTypeName)
        Description copied from interface: EffectiveNodeTypeProvider
        Returns true if typeName is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.
        Specified by:
        isNodeType in interface EffectiveNodeTypeProvider
        Parameters:
        primaryTypeName - the internal oak name of the node to test
        mixinTypes - the internal oak names of the node to test.
        nodeTypeName - The internal oak name of the node type to be tested.
        Returns:
        true if the specified node type is of the given node type.
      • isNodeType

        public boolean isNodeType​(@NotNull
                                  @NotNull java.lang.String typeName,
                                  @NotNull
                                  @NotNull java.lang.String superName)
        Description copied from interface: EffectiveNodeTypeProvider
        Returns true if typeName is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.
        Specified by:
        isNodeType in interface EffectiveNodeTypeProvider
        Parameters:
        typeName - the internal oak name of the node type to test
        superName - The internal oak name of the super type to be tested for.
        Returns:
        true if the specified node type is of the given node type.
      • getEffectiveNodeType

        @NotNull
        public @NotNull EffectiveNodeType getEffectiveNodeType​(@NotNull
                                                               @NotNull javax.jcr.Node node)
                                                        throws javax.jcr.RepositoryException
        Returns all the node types of the given node, in a breadth-first traversal order of the type hierarchy.
        Specified by:
        getEffectiveNodeType in interface EffectiveNodeTypeProvider
        Parameters:
        node - node instance
        Returns:
        all types of the given node
        Throws:
        javax.jcr.RepositoryException - if the type information can not be accessed
        See Also:
        JCR 2.0 Specification, Section 3.7.6.5
      • getRootDefinition

        @NotNull
        public @NotNull javax.jcr.nodetype.NodeDefinition getRootDefinition()
                                                                     throws javax.jcr.RepositoryException
        Specified by:
        getRootDefinition in interface DefinitionProvider
        Throws:
        javax.jcr.RepositoryException
      • getDefinition

        @NotNull
        public @NotNull javax.jcr.nodetype.NodeDefinition getDefinition​(@NotNull
                                                                        @NotNull Tree parent,
                                                                        @NotNull
                                                                        @NotNull java.lang.String nodeName)
                                                                 throws javax.jcr.RepositoryException
        Description copied from interface: DefinitionProvider
        Returns the node definition for a child node of parent named nodeName with a default primary type. First the non-residual child node definitions of parent are checked matching the given node name. Then the residual definitions are checked.
        Specified by:
        getDefinition in interface DefinitionProvider
        Parameters:
        parent - the parent node.
        nodeName - The internal oak name of the child node.
        Returns:
        the applicable node definition.
        Throws:
        javax.jcr.nodetype.ConstraintViolationException - If no matching definition can be found.
        javax.jcr.RepositoryException - If another error occurs.
      • getDefinition

        @NotNull
        public @NotNull javax.jcr.nodetype.NodeDefinition getDefinition​(@NotNull
                                                                        @NotNull Tree parent,
                                                                        @NotNull
                                                                        @NotNull Tree targetNode)
                                                                 throws javax.jcr.RepositoryException
        Description copied from interface: DefinitionProvider
        Calculates the applicable definition for the child node under the given parent node.
        Specified by:
        getDefinition in interface DefinitionProvider
        Parameters:
        parent - The parent node.
        targetNode - The child node for which the definition is calculated.
        Returns:
        the definition of the target node.
        Throws:
        javax.jcr.nodetype.ConstraintViolationException - If no matching definition can be found.
        javax.jcr.RepositoryException - If another error occurs.
      • getDefinition

        @NotNull
        public @NotNull javax.jcr.nodetype.PropertyDefinition getDefinition​(@NotNull
                                                                            @NotNull Tree parent,
                                                                            @NotNull
                                                                            @NotNull PropertyState property,
                                                                            boolean exactTypeMatch)
                                                                     throws javax.jcr.RepositoryException
        Description copied from interface: DefinitionProvider
        Calculates the applicable definition for the property state under the given parent tree.
        Specified by:
        getDefinition in interface DefinitionProvider
        Parameters:
        parent - The parent tree.
        property - The target property.
        Returns:
        the definition for the target property.
        Throws:
        javax.jcr.nodetype.ConstraintViolationException - If no matching definition can be found.
        javax.jcr.RepositoryException - If another error occurs.