Interface StmtContext.Mutable<A,​D extends DeclaredStatement<A>,​E extends EffectiveStatement<A,​D>>

    • Method Detail

      • addToNs

        <K,​V,​T extends K,​U extends V,​N extends ParserNamespace<K,​V>> void addToNs​(Class<@NonNull N> type,
                                                                                                                T key,
                                                                                                                U value)
        Associate a value with a key within a namespace.
        Type Parameters:
        K - namespace key type
        V - namespace value type
        N - namespace type
        T - key type
        U - value type
        Parameters:
        type - Namespace type
        key - Key
        value - value
        Throws:
        NamespaceNotAvailableException - when the namespace is not available.
      • childCopyOf

        StmtContext.Mutable<?,​?,​?> childCopyOf​(StmtContext<?,​?,​?> stmt,
                                                           CopyType type,
                                                           @Nullable QNameModule targetModule)
        Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified child and recording copy type. Resulting object may only be added as a child of this statement.
        Parameters:
        stmt - Statement to be used as a template
        type - Type of copy to record in history
        targetModule - Optional new target module
        Returns:
        copy of statement considering CopyType (augment, uses)
        Throws:
        IllegalArgumentException - if stmt cannot be copied into this statement, for example because it comes from an alien implementation.
        SourceException - instance of SourceException
      • childCopyOf

        default StmtContext.Mutable<?,​?,​?> childCopyOf​(StmtContext<?,​?,​?> stmt,
                                                                   CopyType type)
        Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified child and recording copy type. Resulting object may only be added as a child of this statement.
        Parameters:
        stmt - Statement to be used as a template
        type - Type of copy to record in history
        Returns:
        copy of statement considering CopyType (augment, uses)
        Throws:
        IllegalArgumentException - if stmt cannot be copied into this statement, for example because it comes from an alien implementation.
        SourceException - instance of SourceException
      • replicaAsChildOf

        @NonNull StmtContext.Mutable<A,​D,​E> replicaAsChildOf​(StmtContext.Mutable<?,​?,​?> parent)
        Create a replica of this statement as a substatement of specified parent. The replica must not be modified and acts as a source of EffectiveStatement from outside of parent's subtree.
        Parameters:
        parent - Parent of the replica statement
        Returns:
        replica of this statement
        Throws:
        IllegalArgumentException - if this statement cannot be replicated into parent, for example because it comes from an alien implementation.
      • newInferenceAction

        @NonNull ModelActionBuilder newInferenceAction​(@NonNull ModelProcessingPhase phase)
        Create a new inference action to be executed during specified phase. The action cannot be cancelled and will be executed even if its definition remains incomplete. The specified phase cannot complete until this action is resolved. If the action cannot be resolved, model processing will fail.
        Parameters:
        phase - Target phase in which the action will resolved.
        Returns:
        A new action builder.
        Throws:
        NullPointerException - if the specified phase is null
      • addContext

        <K,​KT extends K,​N extends StatementNamespace<K,​?,​?>> void addContext​(Class<@NonNull N> namespace,
                                                                                                     KT key,
                                                                                                     StmtContext<?,​?,​?> stmt)
        Adds s statement to namespace map with a key.
        Parameters:
        namespace - StatementNamespace child that determines namespace to be added to
        key - of type according to namespace class specification
        stmt - to be added to namespace map
      • setRootVersion

        void setRootVersion​(YangVersion version)
        Set version of root statement context.
        Parameters:
        version - of root statement context
      • addRequiredSource

        void addRequiredSource​(SourceIdentifier dependency)
        Add required module. Based on these dependencies are collected required sources from library sources.
        Parameters:
        dependency - SourceIdentifier of module required by current root context
      • addAsEffectOfStatement

        void addAsEffectOfStatement​(Collection<? extends StmtContext<?,​?,​?>> ctxs)
      • setRootIdentifier

        void setRootIdentifier​(SourceIdentifier identifier)
        Set identifier of current root context.
        Parameters:
        identifier - of current root context, must not be null
      • setIsSupportedToBuildEffective

        void setIsSupportedToBuildEffective​(boolean isSupportedToBuild)