Class AbstractNodeType

    • Constructor Detail

      • AbstractNodeType

        public AbstractNodeType​(QNodeTypeDefinition ntd,
                                AbstractNodeTypeManager ntMgr,
                                NamePathResolver resolver)
        Create a new AbstractNodeType.
        Parameters:
        ntd - the underlying node type definition.
        ntMgr - the node type manager.
        resolver - the name/path resolver of the session that created this node type instance.
    • Method Detail

      • getDefinition

        public QNodeTypeDefinition getDefinition()
        Returns the node type definition.
        Returns:
        the internal node type definition.
      • getName

        public java.lang.String getName()
        Returns the name of the node type.

        In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.

        Specified by:
        getName in interface NodeTypeDefinition
        Returns:
        a String
      • isAbstract

        public boolean isAbstract()
        Returns true if this is an abstract node type; returns false otherwise.

        An abstract node type is one that cannot be assigned as the primary or mixin type of a node but can be used in the definitions of other node types as a superclass.

        In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return false.

        Specified by:
        isAbstract in interface NodeTypeDefinition
        Returns:
        a boolean
      • isMixin

        public boolean isMixin()
        Returns true if this is a mixin type; returns false if it is primary.

        In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return false.

        Specified by:
        isMixin in interface NodeTypeDefinition
        Returns:
        a boolean
      • getDeclaredSupertypeNames

        public java.lang.String[] getDeclaredSupertypeNames()
        Returns the names of the supertypes actually declared in this node type.

        In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return an empty array.

        Specified by:
        getDeclaredSupertypeNames in interface NodeTypeDefinition
        Returns:
        an array of Strings
      • getDeclaredSupertypes

        public NodeType[] getDeclaredSupertypes()
        Returns the direct supertypes of this node type in the node type inheritance hierarchy, that is, those actually declared in this node type. In single-inheritance systems, this will always be an array of size 0 or 1. In systems that support multiple inheritance of node types this array may be of size greater than 1.
        Specified by:
        getDeclaredSupertypes in interface NodeType
        Returns:
        an array of NodeType objects.
        See Also:
        NodeType.getSupertypes()
      • getDeclaredSubtypes

        public NodeTypeIterator getDeclaredSubtypes()
        Description copied from interface: NodeType
        Returns the direct subtypes of this node type in the node type inheritance hierarchy, that is, those which actually declared this node type in their list of supertypes.
        Specified by:
        getDeclaredSubtypes in interface NodeType
        Returns:
        an NodeTypeIterator.
        See Also:
        NodeType.getDeclaredSubtypes()
      • getDeclaredChildNodeDefinitions

        public NodeDefinition[] getDeclaredChildNodeDefinitions()
        Returns an array containing the child node definitions actually declared in this node type.

        In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.

        Specified by:
        getDeclaredChildNodeDefinitions in interface NodeTypeDefinition
        Returns:
        an array of NodeDefinitions
      • getPrimaryItemName

        public java.lang.String getPrimaryItemName()
        Returns the name of the primary item (one of the child items of the nodes of this node type). If this node has no primary item, then this method returns null. This indicator is used by the method Node.getPrimaryItem().

        In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.

        Specified by:
        getPrimaryItemName in interface NodeTypeDefinition
        Returns:
        a String
      • isNodeType

        public boolean isNodeType​(java.lang.String nodeTypeName)
        Returns true if the name of this node type or any of its direct or indirect supertypes is equal to nodeTypeName, otherwise returns false.
        Specified by:
        isNodeType in interface NodeType
        Parameters:
        nodeTypeName - the name of a node type.
        Returns:
        a boolean
      • isNodeType

        public abstract boolean isNodeType​(Name nodeTypeName)
        Test if this nodetype equals or is directly or indirectly derived from the node type with the specified nodeTypeName, without checking of a node type of that name really exists.
        Parameters:
        nodeTypeName - A node type name.
        Returns:
        true if this node type represents the type with the given nodeTypeName or if it is directly or indirectly derived from it; otherwise false. If no node type exists with the specified name this method will also return false.