Skip to content

Commit

Permalink
Merge pull request #258 from Tobianas/mainCalcium
Browse files Browse the repository at this point in the history
Calcium integration
  • Loading branch information
ihrasko committed May 7, 2024
2 parents eff811f + 165907b commit edb714c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>io.lighty.core</groupId>
<artifactId>lighty-parent</artifactId>
<version>19.0.0</version>
<version>20.0.0</version>
<relativePath/>
</parent>

Expand Down
17 changes: 9 additions & 8 deletions src/main/java/io/lighty/yang/validator/YangContextFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.source.YangTextSource;
import org.opendaylight.yangtools.yang.model.api.stmt.FeatureSet;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
import org.opendaylight.yangtools.yang.model.spi.source.FileYangTextSource;
import org.opendaylight.yangtools.yang.parser.api.YangParser;
import org.opendaylight.yangtools.yang.parser.api.YangParserException;
import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
Expand Down Expand Up @@ -70,17 +71,17 @@ EffectiveModelContext createContext(final boolean useAllFiles) throws IOExceptio

final List<String> names = new ArrayList<>();
for (final File file : testFiles) {
final YangTextSchemaSource yangTextSchemaSource = YangTextSchemaSource.forPath(file.toPath());
names.add(yangTextSchemaSource.getIdentifier().name().getLocalName());
parser.addSource(yangTextSchemaSource);
final YangTextSource yangTextSource = new FileYangTextSource(file.toPath());
names.add(yangTextSource.sourceId().name().getLocalName());
parser.addSource(yangTextSource);
}
for (final File file : libFiles) {
final YangTextSchemaSource yangTextSchemaSource = YangTextSchemaSource.forPath(file.toPath());
if (!names.contains(yangTextSchemaSource.getIdentifier().name().getLocalName())) {
final YangTextSource yangTextSource = new FileYangTextSource(file.toPath());
if (!names.contains(yangTextSource.sourceId().name().getLocalName())) {
if (useAllFiles) {
parser.addSource(yangTextSchemaSource);
parser.addSource(yangTextSource);
} else {
parser.addLibSource(YangTextSchemaSource.forPath(file.toPath()));
parser.addLibSource(new FileYangTextSource(file.toPath()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public TrackingXmlParserStream parse(final XMLStreamReader reader) throws XMLStr
if (reader.hasNext()) {
reader.nextTag();
final var nodeDataWithSchema = AbstractNodeDataWithSchema.of(parentNode);
final SchemaInferenceStack schemaIS = SchemaInferenceStack.of(codecs.getEffectiveModelContext());
final SchemaInferenceStack schemaIS = SchemaInferenceStack.of(codecs.modelContext());
read(reader, nodeDataWithSchema, reader.getLocalName(), tree, schemaIS);
nodeDataWithSchema.write(writer);
}
Expand Down

0 comments on commit edb714c

Please sign in to comment.