Class YangStatementStreamSource
java.lang.Object
org.opendaylight.yangtools.concepts.AbstractIdentifiable<T,T>
org.opendaylight.yangtools.concepts.AbstractSimpleIdentifiable<SourceIdentifier>
org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource
- All Implemented Interfaces:
Identifiable<SourceIdentifier>
,StatementStreamSource
@Beta
public final class YangStatementStreamSource
extends AbstractSimpleIdentifiable<SourceIdentifier>
implements StatementStreamSource
This class represents implementation of StatementStreamSource in order to emit YANG statements using supplied
StatementWriter.
- Author:
- Robert Varga
-
Method Summary
Modifier and TypeMethodDescriptionstatic YangStatementStreamSource
create
(SourceIdentifier identifier, IRStatement rootStatement, String symbolicName) static YangStatementStreamSource
create
(YangIRSchemaSource source) Create aYangStatementStreamSource
for aYangIRSchemaSource
.static YangStatementStreamSource
create
(YangTextSource source) Create aYangStatementStreamSource
for aYangTextSource
.void
writeFull
(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixResolver prefixes, YangVersion yangVersion) Emits every statements present in this statement source to suppliedwriter
based on specified yang version.void
writeLinkage
(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixResolver preLinkagePrefixes, YangVersion yangVersion) Emits only linkage-related statements to suppliedwriter
based on specified YANG version.void
writeLinkageAndStatementDefinitions
(StatementWriter writer, QNameToStatementDefinition stmtDef, PrefixResolver 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 Details
-
create
public static YangStatementStreamSource create(YangTextSource source) throws IOException, YangSyntaxErrorException Create aYangStatementStreamSource
for aYangTextSource
.- 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
Create aYangStatementStreamSource
for aYangIRSchemaSource
.- Parameters:
source
- YangTextSchemaSource, must not be null- Returns:
- A new
YangStatementStreamSource
- Throws:
NullPointerException
- ifsource
is null
-
create
public static YangStatementStreamSource create(SourceIdentifier identifier, IRStatement rootStatement, String symbolicName) -
writePreLinkage
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, PrefixResolver 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, PrefixResolver 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, PrefixResolver 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.
-