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
,MutationBehaviour<Immutable>
,DeclarationReference
@Beta public abstract class ExplicitStatement extends StatementSourceReference implements DeclarationReference
Reference of statement source present in textual source format. Utility implementation ofStatementSourceReference
for textual sources, this is preferredStatementSourceReference
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NonNull ExplicitStatement
atPosition(int line, int column)
static @NonNull ExplicitStatement
atPosition(@Nullable String fileName, int line, int column)
DeclarationReference
declarationReference()
Returns theDeclarationReference
associated with this reference, if available.boolean
equals(Object obj)
int
hashCode()
static @NonNull ExplicitStatement
inFile(@NonNull String fileName)
StatementOrigin
statementOrigin()
Returns theStatementOrigin
associated with this reference.String
toHumanReadable()
Returns human readable representation of this reference.String
toString()
Returns human readable representation of statement source.
-
-
-
Method Detail
-
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 StatementOrigin statementOrigin()
Description copied from class:StatementSourceReference
Returns theStatementOrigin
associated with this reference.- Specified by:
statementOrigin
in classStatementSourceReference
- Returns:
StatementOrigin.DECLARATION
if statement was explicitly declared in YANG model source,StatementOrigin.CONTEXT
if statement was inferred.
-
declarationReference
public final DeclarationReference declarationReference()
Description copied from class:StatementSourceReference
Returns theDeclarationReference
associated with this reference, if available.- Specified by:
declarationReference
in classStatementSourceReference
- Returns:
- A
DeclarationReference
or null.
-
toHumanReadable
public final String toHumanReadable()
Description copied from interface:DeclarationReference
Returns human readable representation of this reference. This method does not prescribe any format of the returned string.- Specified by:
toHumanReadable
in interfaceDeclarationReference
- Returns:
- human readable representation of this reference.
-
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 classStatementSourceReference
- Returns:
- human readable representation of statement source.
-
-