@Beta public final class YangStatementStreamSource extends Object implements StatementStreamSource
Modifier and Type | Method and Description |
---|---|
static YangStatementStreamSource |
create(ASTSchemaSource source)
Create a
YangStatementStreamSource for a ASTSchemaSource . |
static YangStatementStreamSource |
create(SourceIdentifier identifier,
YangStatementParser.StatementContext context,
String symbolicName) |
static YangStatementStreamSource |
create(YangTextSchemaSource source)
Create a
YangStatementStreamSource for a YangTextSchemaSource . |
SourceIdentifier |
getIdentifier()
Return this objects Identifier.
|
org.antlr.v4.runtime.ParserRuleContext |
getYangAST() |
String |
toString() |
void |
writeFull(StatementWriter writer,
QNameToStatementDefinition stmtDef,
PrefixToModule prefixes)
Emits every statements present in this statement source to supplied
writer . |
void |
writeFull(StatementWriter writer,
QNameToStatementDefinition stmtDef,
PrefixToModule prefixes,
YangVersion yangVersion)
Emits every statements present in this statement source to supplied
writer based on specified yang version. |
void |
writeLinkage(StatementWriter writer,
QNameToStatementDefinition stmtDef,
PrefixToModule preLinkagePrefixes)
Emits only linkage-related statements to supplied
writer . |
void |
writeLinkage(StatementWriter writer,
QNameToStatementDefinition stmtDef,
PrefixToModule preLinkagePrefixes,
YangVersion yangVersion)
Emits only linkage-related statements to supplied
writer based on specified YANG version. |
void |
writeLinkageAndStatementDefinitions(StatementWriter writer,
QNameToStatementDefinition stmtDef,
PrefixToModule prefixes)
Emits only linkage and language extension statements to supplied
writer . |
void |
writeLinkageAndStatementDefinitions(StatementWriter writer,
QNameToStatementDefinition stmtDef,
PrefixToModule prefixes,
YangVersion yangVersion)
Emits only linkage and language extension statements to supplied
writer based on specified YANG version. |
void |
writePreLinkage(StatementWriter writer,
QNameToStatementDefinition stmtDef)
Emits only pre-linkage-related statements to supplied
writer . |
public static YangStatementStreamSource create(YangTextSchemaSource source) throws IOException, YangSyntaxErrorException
YangStatementStreamSource
for a YangTextSchemaSource
.source
- YangTextSchemaSource, must not be nullYangStatementStreamSource
IOException
- When we fail to read the sourceYangSyntaxErrorException
- If the source fails basic parsingpublic static YangStatementStreamSource create(ASTSchemaSource source)
YangStatementStreamSource
for a ASTSchemaSource
.source
- YangTextSchemaSource, must not be nullYangStatementStreamSource
public static YangStatementStreamSource create(SourceIdentifier identifier, YangStatementParser.StatementContext context, String symbolicName)
public void writePreLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef)
StatementStreamSource
writer
.writePreLinkage
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit
statements.stmtDef
- Map of available statement definitions. Only these statements
may be written to statement writer, source MUST ignore and MUST NOT
emit any other statements.public void writeLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule preLinkagePrefixes)
StatementStreamSource
writer
.writeLinkage
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit
statements.stmtDef
- Map of available statement definitions. Only these statements
may be written to statement writer, source MUST ignore and MUST NOT
emit any other statements.preLinkagePrefixes
- Pre-linkage map of source-specific prefixes to namespacespublic void writeLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule preLinkagePrefixes, YangVersion yangVersion)
StatementStreamSource
writer
based on specified YANG version.
Default implementation does not make any differences between versions.writeLinkage
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit
statements.stmtDef
- Map of available statement definitions. Only these statements
may be written to statement writer, source MUST ignore and
MUST NOT emit any other statements.preLinkagePrefixes
- Pre-linkage map of source-specific prefixes to namespacesyangVersion
- yang version.public void writeLinkageAndStatementDefinitions(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes)
StatementStreamSource
writer
.writeLinkageAndStatementDefinitions
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit statements.stmtDef
- Map of available statement definitions. Only these statements
may be written to statement writer, source MUST ignore and MUST NOT
emit any other statements.prefixes
- Map of source-specific prefixes to namespacespublic void writeLinkageAndStatementDefinitions(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes, YangVersion yangVersion)
StatementStreamSource
writer
based on specified YANG version. Default implementation
does not make any differences between versions.writeLinkageAndStatementDefinitions
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit
statements.stmtDef
- Map of available statement definitions. Only these statements
may be written to statement writer, source MUST ignore and
MUST NOT emit any other statements.prefixes
- Map of source-specific prefixes to namespacesyangVersion
- YANG version.public void writeFull(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes)
StatementStreamSource
writer
.writeFull
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit
statements.stmtDef
- Map of available statement definitions.prefixes
- Map of source-specific prefixes to namespacespublic void writeFull(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes, YangVersion yangVersion)
StatementStreamSource
writer
based on specified yang version. Default implementation
does not make any differences between versions.writeFull
in interface StatementStreamSource
writer
- StatementWriter
which should be used to emit
statements.stmtDef
- Map of available statement definitions.prefixes
- Map of source-specific prefixes to namespacesyangVersion
- yang version.public SourceIdentifier getIdentifier()
Identifiable
getIdentifier
in interface Identifiable<SourceIdentifier>
public org.antlr.v4.runtime.ParserRuleContext getYangAST()
Copyright © 2019 OpenDaylight. All rights reserved.