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 String getSourceName()
public StatementSource getStatementSource()
StatementSourceReference
getStatementSource
in interface StatementSourceReference
StatementSource.DECLARATION
if statement was explicitly
declared in YANG model source, StatementSource.CONTEXT
if statement
was inferred.public abstract String toString()
StatementSourceReference
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 StatementSourceReference
toString
in class Object
public static DeclarationInTextSource inSource(String sourceName)
public static DeclarationInTextSource atLine(String sourceName, int line)
public static DeclarationInTextSource atPosition(String sourceName, int line, int position)
Copyright © 2018 OpenDaylight. All rights reserved.