public abstract class DeclarationInTextSource extends Object implements StatementSourceReference
StatementSourceReference for textual sources, this is prefered 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 prefered since it provides most context to debug YANG model.
atLine(String, int)- provides source and line of statement location.
inSource(String) - least specific reference, should be used only if any of previous
references are unable to create / derive from source.
| Modifier and Type | Method and Description |
|---|---|
static DeclarationInTextSource |
atLine(String sourceName,
int line) |
static DeclarationInTextSource |
atPosition(String sourceName,
int line,
int position) |
String |
getSourceName() |
StatementSource |
getStatementSource()
Returns source type.
|
static DeclarationInTextSource |
inSource(String sourceName) |
abstract String |
toString()
Returns human readable representation of statement source.
|
public static DeclarationInTextSource inSource(String sourceName)
public static DeclarationInTextSource atLine(String sourceName, int line)
public static DeclarationInTextSource atPosition(String sourceName, int line, int position)
public String getSourceName()
public StatementSource getStatementSource()
StatementSourceReferencegetStatementSource in interface StatementSourceReferenceStatementSource.DECLARATION if statement was explicitly declared in YANG model source,
StatementSource.CONTEXT if statement was inferred.public abstract String toString()
StatementSourceReference
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.
toString in interface StatementSourceReferencetoString in class ObjectCopyright © 2019 OpenDaylight. All rights reserved.