Class StatementDeclaration
java.lang.Object
org.opendaylight.yangtools.yang.model.api.meta.StatementSourceReference
org.opendaylight.yangtools.yang.model.api.meta.StatementDeclaration
- All Implemented Interfaces:
Immutable
,DeclarationReference
- Direct Known Subclasses:
StatementDeclaration.InText
@NonNullByDefault
public abstract class StatementDeclaration
extends StatementSourceReference
implements DeclarationReference
A
StatementSourceReference
which acts as its own DeclarationReference
, i.e. referring to a statement
source present in textual source format.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AStatementDeclaration
which acts as its ownDeclarationInText
.static class
AStatementDeclaration.InText
which acts as its ownDeclarationInFile
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
column()
final @NonNull DeclarationReference
Returns theDeclarationReference
associated with this reference, if available.protected abstract @Nullable String
file()
protected abstract int
line()
final StatementOrigin
Returns theStatementOrigin
associated with this reference.final String
Returns human readable representation of this reference.final String
toString()
Returns human readable representation of statement source.
-
Constructor Details
-
StatementDeclaration
public StatementDeclaration()
-
-
Method Details
-
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
Description copied from class:StatementSourceReference
Returns theDeclarationReference
associated with this reference, if available.- Specified by:
declarationReference
in classStatementSourceReference
- Returns:
- A
DeclarationReference
or null.
-
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
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.
-
file
-
line
protected abstract int line() -
column
protected abstract int column()
-