Class ExplicitStatement
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:
atPosition(String, int, int)- provides most specific reference of statement location, this is most preferred since it provides most context to debug YANG model.atPosition(int, int)- provides location in text without knowing the name of the text file.inFile(String)- provides a source name.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull ExplicitStatementatPosition(int line, int column) static @NonNull ExplicitStatementatPosition(@Nullable String fileName, int line, int column) final org.opendaylight.yangtools.yang.model.api.meta.DeclarationReferenceReturns theDeclarationReferenceassociated with this reference, if available.final booleanfinal inthashCode()static @NonNull ExplicitStatementfinal org.opendaylight.yangtools.yang.model.api.meta.StatementOriginReturns theStatementOriginassociated with this reference.final Stringfinal StringtoString()Returns human readable representation of statement source.
-
Method Details
-
atPosition
-
atPosition
public static @NonNull ExplicitStatement atPosition(@Nullable String fileName, int line, int column) -
inFile
-
statementOrigin
public final org.opendaylight.yangtools.yang.model.api.meta.StatementOrigin statementOrigin()Description copied from class:StatementSourceReferenceReturns theStatementOriginassociated with this reference.- Specified by:
statementOriginin classStatementSourceReference- Returns:
StatementOrigin.DECLARATIONif statement was explicitly declared in YANG model source,StatementOrigin.CONTEXTif statement was inferred.
-
declarationReference
public final org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference declarationReference()Description copied from class:StatementSourceReferenceReturns theDeclarationReferenceassociated with this reference, if available.- Specified by:
declarationReferencein classStatementSourceReference- Returns:
- A
DeclarationReferenceor null.
-
toHumanReadable
- Specified by:
toHumanReadablein interfaceorg.opendaylight.yangtools.yang.model.api.meta.DeclarationReference
-
hashCode
public final int hashCode() -
equals
-
toString
Description copied from class:StatementSourceReferenceReturns 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:
toStringin classStatementSourceReference- Returns:
- human readable representation of statement source.
-