if (module.getYangVersion() == YangVersion.VERSION_1) { final Optional<Revision> impRevision = imported.get(toName); if (impRevision != null && impRevision.isPresent() && !impRevision.equals(toRevision)
if (module.getYangVersion() == YangVersion.VERSION_1) { final Optional<Revision> impRevision = imported.get(toName); if (impRevision != null && impRevision.isPresent() && !impRevision.equals(toRevision)
private void emitModuleHeader(final Module input) { emitYangVersionNode(input.getYangVersion()); emitNamespace(input.getNamespace()); emitPrefixNode(input.getPrefix()); }
static void writeToStatementWriter(final Module module, final SchemaContext ctx, final StatementTextWriter statementWriter, final boolean emitInstantiated) { final YangModuleWriter yangSchemaWriter = SchemaToStatementWriterAdaptor.from(statementWriter); final Map<QName, StatementDefinition> extensions = ExtensionStatement.mapFrom(ctx.getExtensions()); if (module instanceof EffectiveStatement && !emitInstantiated) { /* * if module is an effective statement and we don't want to export * instantiated statements (e.g. statements added by uses or * augment) we can get declared form i.e. ModuleStatement and then * use DeclaredSchemaContextEmitter */ new DeclaredSchemaContextEmitter(yangSchemaWriter, extensions, module.getYangVersion()) .emitModule(((EffectiveStatement<?, ?>) module).getDeclared()); } else { /* * if we don't have access to declared form of supplied module or we * want to emit also instantiated statements (e.g. statements added * by uses or augment), we use EffectiveSchemaContextEmitter. */ new EffectiveSchemaContextEmitter(yangSchemaWriter, extensions, module.getYangVersion(), emitInstantiated) .emitModule(module); } }
_builder.append(" "); _builder.append("yang-version "); String _yangVersion = module.getYangVersion(); _builder.append(_yangVersion, " "); _builder.append(";");