Interface ModelActionBuilder.InferenceAction

Enclosing interface:
ModelActionBuilder

public static interface ModelActionBuilder.InferenceAction
User-defined inference action.
  • Method Details

    • apply

      Invoked once all prerequisites were met and forward references were resolved and inference action should be applied. Implementors may perform necessary changes to mutable objects which were declared.
      Throws:
      InferenceException - If inference action can not be processed. Note that this exception be used for user to debug YANG sources, so should provide helpful context to fix issue in sources.
    • prerequisiteFailed

      void prerequisiteFailed(Collection<? extends ModelActionBuilder.Prerequisite<?>> failed)
      Invoked once one of prerequisites was not met, even after all other satisfiable inference actions were processed.

      Implementors MUST throw InferenceException if semantic processing of model should be stopped and failed.

      List of failed prerequisites should be used to select right message / error type to debug problem in YANG sources.

      Parameters:
      failed - collection of prerequisites which were not met
      Throws:
      InferenceException - If inference action can not be processed. Note that this exception be used by user to debug YANG sources, hence it should provide helpful context to fix the issue in sources.
    • prerequisiteUnavailable

      @Beta default void prerequisiteUnavailable(ModelActionBuilder.Prerequisite<?> unavail)
      Invoked once the prerequisite is deemed unavailable due to conformance reasons. This typically happens when a feature-dependent prerequisite does not have the appropriate feature activated.

      The default implementation invokes prerequisiteFailed(Collection), implementations should override this method if they wish, for example, to ignore the missing prerequisite.

      Parameters:
      unavail - Unavailable prerequisite