Class YangStatementStreamSource
- java.lang.Object
-
- org.opendaylight.yangtools.concepts.AbstractIdentifiable<SourceIdentifier>
-
- org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource
-
- All Implemented Interfaces:
Identifiable<SourceIdentifier>
,StatementStreamSource
@Beta public final class YangStatementStreamSource extends AbstractIdentifiable<SourceIdentifier> implements StatementStreamSource
This class represents implementation of StatementStreamSource in order to emit YANG statements using supplied StatementWriter.- Author:
- Robert Varga
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static YangStatementStreamSource
create(SourceIdentifier identifier, YangStatementParser.StatementContext context, String symbolicName)
static YangStatementStreamSource
create(YangTextSchemaSource source)
Create aYangStatementStreamSource
for aYangTextSchemaSource
.static YangStatementStreamSource
create(ASTSchemaSource source)
Create aYangStatementStreamSource
for aASTSchemaSource
.org.antlr.v4.runtime.ParserRuleContext
getYangAST()
Deprecated, for removal: This API element is subject to removal in a future version.void
writeFull(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes, YangVersion yangVersion)
Emits every statements present in this statement source to suppliedwriter
based on specified yang version.void
writeLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule preLinkagePrefixes, YangVersion yangVersion)
Emits only linkage-related statements to suppliedwriter
based on specified YANG version.void
writeLinkageAndStatementDefinitions(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes, YangVersion yangVersion)
Emits only linkage and language extension statements to suppliedwriter
based on specified YANG version.void
writePreLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef)
Emits only pre-linkage-related statements to suppliedwriter
.-
Methods inherited from class org.opendaylight.yangtools.concepts.AbstractIdentifiable
addToStringAttributes, getIdentifier, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opendaylight.yangtools.concepts.Identifiable
getIdentifier
-
-
-
-
Method Detail
-
create
public static YangStatementStreamSource create(YangTextSchemaSource source) throws IOException, YangSyntaxErrorException
Create aYangStatementStreamSource
for aYangTextSchemaSource
.- Parameters:
source
- YangTextSchemaSource, must not be null- Returns:
- A new
YangStatementStreamSource
- Throws:
IOException
- When we fail to read the sourceYangSyntaxErrorException
- If the source fails basic parsing
-
create
public static YangStatementStreamSource create(ASTSchemaSource source)
Create aYangStatementStreamSource
for aASTSchemaSource
.- Parameters:
source
- YangTextSchemaSource, must not be null- Returns:
- A new
YangStatementStreamSource
-
create
public static YangStatementStreamSource create(SourceIdentifier identifier, YangStatementParser.StatementContext context, String symbolicName)
-
writePreLinkage
public void writePreLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef)
Description copied from interface:StatementStreamSource
Emits only pre-linkage-related statements to suppliedwriter
.- Specified by:
writePreLinkage
in interfaceStatementStreamSource
- Parameters:
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.
-
writeLinkage
public void writeLinkage(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule preLinkagePrefixes, YangVersion yangVersion)
Description copied from interface:StatementStreamSource
Emits only linkage-related statements to suppliedwriter
based on specified YANG version. Default implementation does not make any differences between versions.- Specified by:
writeLinkage
in interfaceStatementStreamSource
- Parameters:
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.
-
writeLinkageAndStatementDefinitions
public void writeLinkageAndStatementDefinitions(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes, YangVersion yangVersion)
Description copied from interface:StatementStreamSource
Emits only linkage and language extension statements to suppliedwriter
based on specified YANG version. Default implementation does not make any differences between versions.- Specified by:
writeLinkageAndStatementDefinitions
in interfaceStatementStreamSource
- Parameters:
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.
-
writeFull
public void writeFull(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixToModule prefixes, YangVersion yangVersion)
Description copied from interface:StatementStreamSource
Emits every statements present in this statement source to suppliedwriter
based on specified yang version. Default implementation does not make any differences between versions.- Specified by:
writeFull
in interfaceStatementStreamSource
- Parameters:
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.
-
getYangAST
@Deprecated(forRemoval=true) public org.antlr.v4.runtime.ParserRuleContext getYangAST()
Deprecated, for removal: This API element is subject to removal in a future version.
-
-