java.lang.Object
org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference
org.opendaylight.yangtools.yang.parser.spi.source.ExplicitStatement
All Implemented Interfaces:
Immutable, org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference

@Beta public abstract class ExplicitStatement extends StatementSourceReference implements org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference
Reference of statement source present in textual source format. Utility implementation of StatementSourceReference for textual sources, this is preferred StatementSourceReference for implementations of YANG / YIN statement stream sources.

To create source reference use one of this static factories:

  • Method Details

    • atPosition

      public static @NonNull ExplicitStatement atPosition(int line, int column)
    • atPosition

      public static @NonNull ExplicitStatement atPosition(@Nullable String fileName, int line, int column)
    • inFile

      public static @NonNull ExplicitStatement inFile(@NonNull String fileName)
    • statementOrigin

      public final org.opendaylight.yangtools.yang.model.api.meta.StatementOrigin statementOrigin()
      Description copied from class: StatementSourceReference
      Returns the StatementOrigin associated with this reference.
      Specified by:
      statementOrigin in class StatementSourceReference
      Returns:
      StatementOrigin.DECLARATION if statement was explicitly declared in YANG model source, StatementOrigin.CONTEXT if statement was inferred.
    • declarationReference

      public final org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference declarationReference()
      Description copied from class: StatementSourceReference
      Returns the DeclarationReference associated with this reference, if available.
      Specified by:
      declarationReference in class StatementSourceReference
      Returns:
      A DeclarationReference or null.
    • toHumanReadable

      public final String toHumanReadable()
      Specified by:
      toHumanReadable in interface org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Description copied from class: StatementSourceReference
      Returns human readable representation of statement source.

      Implementations of this interface should override StatementSourceReference.toString(), since it may be used in error reporting to provide context information for model designer to debug errors in its mode.

      Specified by:
      toString in class StatementSourceReference
      Returns:
      human readable representation of statement source.