Class SchemaInferenceStack

    • Constructor Detail

      • SchemaInferenceStack

        public SchemaInferenceStack​(EffectiveModelContext effectiveModel)
        Create a new empty stack backed by an effective model.
        Parameters:
        effectiveModel - EffectiveModelContext to which this stack is attached
        Throws:
        NullPointerException - effectiveModel is null
    • Method Detail

      • copy

        public @NonNull SchemaInferenceStack copy()
        Create a deep copy of this object.
        Returns:
        An isolated copy of this object
      • isEmpty

        public boolean isEmpty()
        Check if this stack is empty.
        Returns:
        True if this stack has not entered any node.
      • inInstantiatedContext

        public boolean inInstantiatedContext()
        Check if the stack is in instantiated context. This indicates the stack is non-empty and there is no grouping (or similar construct) present in the stack.
        Returns:
        False if the stack is empty or contains a grouping, true otherwise.
      • clear

        public void clear()
        Reset this stack to empty state.
      • enterGrouping

        public @NonNull GroupingEffectiveStatement enterGrouping​(QName nodeIdentifier)
        Lookup a grouping by its node identifier and push it to the stack.
        Parameters:
        nodeIdentifier - Node identifier of the grouping to enter
        Returns:
        Resolved grouping
        Throws:
        NullPointerException - if nodeIdentifier is null
        IllegalArgumentException - if the corresponding grouping cannot be found
      • enterSchemaTree

        public @NonNull EffectiveStatement<QName,​?> enterSchemaTree​(QName nodeIdentifier)
        Lookup a schema tree child by its node identifier and push it to the stack.
        Parameters:
        nodeIdentifier - Node identifier of the schema tree child to enter
        Returns:
        Resolved schema tree child
        Throws:
        NullPointerException - if nodeIdentifier is null
        IllegalArgumentException - if the corresponding grouping cannot be found
      • toSchemaNodeIdentifier

        public @NonNull SchemaNodeIdentifier.Absolute toSchemaNodeIdentifier()
        Convert current state into an absolute schema node identifier.
        Returns:
        Absolute schema node identifier representing current state
        Throws:
        IllegalStateException - if current state is not instantiated
      • toSchemaPath

        @Deprecated
        public @NonNull SchemaPath toSchemaPath()
        Deprecated.
        This method is meant only for interoperation with SchemaPath-based APIs.
        Convert current state into a SchemaPath.
        Returns:
        Absolute SchemaPath representing current state
        Throws:
        IllegalStateException - if current state is not instantiated