diff --git a/README-CHANGES.xml b/README-CHANGES.xml index b198863..795f1b1 100644 --- a/README-CHANGES.xml +++ b/README-CHANGES.xml @@ -34,7 +34,7 @@ - + @@ -49,6 +49,11 @@ + + + + + diff --git a/com.io7m.trasco.api/pom.xml b/com.io7m.trasco.api/pom.xml index 4da7c76..83839b1 100644 --- a/com.io7m.trasco.api/pom.xml +++ b/com.io7m.trasco.api/pom.xml @@ -9,7 +9,7 @@ com.io7m.trasco com.io7m.trasco - 2.0.2-SNAPSHOT + 3.0.0-SNAPSHOT com.io7m.trasco.api @@ -38,6 +38,10 @@ com.io7m.anethum com.io7m.anethum.api + + com.io7m.jxe + com.io7m.jxe.core + diff --git a/com.io7m.trasco.api/src/main/java/com/io7m/trasco/api/TrSchemaRevisionSetParserFactoryType.java b/com.io7m.trasco.api/src/main/java/com/io7m/trasco/api/TrSchemaRevisionSetParserFactoryType.java index 0de2b57..d97ae42 100644 --- a/com.io7m.trasco.api/src/main/java/com/io7m/trasco/api/TrSchemaRevisionSetParserFactoryType.java +++ b/com.io7m.trasco.api/src/main/java/com/io7m/trasco/api/TrSchemaRevisionSetParserFactoryType.java @@ -18,13 +18,14 @@ package com.io7m.trasco.api; import com.io7m.anethum.api.ParserFactoryType; +import com.io7m.jxe.core.JXEHardenedSAXParsers; /** * A factory of revision set parsers. */ public interface TrSchemaRevisionSetParserFactoryType - extends ParserFactoryType + extends ParserFactoryType { } diff --git a/com.io7m.trasco.api/src/main/java/module-info.java b/com.io7m.trasco.api/src/main/java/module-info.java index 60f353a..9a576da 100644 --- a/com.io7m.trasco.api/src/main/java/module-info.java +++ b/com.io7m.trasco.api/src/main/java/module-info.java @@ -23,9 +23,10 @@ requires static org.osgi.annotation.bundle; requires static org.osgi.annotation.versioning; - requires transitive com.io7m.anethum.api; - requires transitive com.io7m.seltzer.api; - requires transitive java.sql; + requires com.io7m.anethum.api; + requires com.io7m.jxe.core; + requires com.io7m.seltzer.api; + requires java.sql; exports com.io7m.trasco.api; } diff --git a/com.io7m.trasco.tests/pom.xml b/com.io7m.trasco.tests/pom.xml index 98e64cc..3114d60 100644 --- a/com.io7m.trasco.tests/pom.xml +++ b/com.io7m.trasco.tests/pom.xml @@ -9,7 +9,7 @@ com.io7m.trasco com.io7m.trasco - 2.0.2-SNAPSHOT + 3.0.0-SNAPSHOT com.io7m.trasco.tests diff --git a/com.io7m.trasco.tests/src/main/java/module-info.java b/com.io7m.trasco.tests/src/main/java/module-info.java index 0e8eb40..2160a27 100644 --- a/com.io7m.trasco.tests/src/main/java/module-info.java +++ b/com.io7m.trasco.tests/src/main/java/module-info.java @@ -26,10 +26,11 @@ requires org.junit.platform.engine; requires org.junit.platform.launcher; - requires org.xerial.sqlitejdbc; + requires com.io7m.anethum.api; requires com.io7m.trasco.api; requires com.io7m.trasco.vanilla; requires org.slf4j; + requires org.xerial.sqlitejdbc; exports com.io7m.trasco.tests; } diff --git a/com.io7m.trasco.vanilla/pom.xml b/com.io7m.trasco.vanilla/pom.xml index 654da61..b893077 100644 --- a/com.io7m.trasco.vanilla/pom.xml +++ b/com.io7m.trasco.vanilla/pom.xml @@ -9,7 +9,7 @@ com.io7m.trasco com.io7m.trasco - 2.0.2-SNAPSHOT + 3.0.0-SNAPSHOT com.io7m.trasco.vanilla diff --git a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/TrSchemaRevisionSetParsers.java b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/TrSchemaRevisionSetParsers.java index ef89db6..c5cf73c 100644 --- a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/TrSchemaRevisionSetParsers.java +++ b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/TrSchemaRevisionSetParsers.java @@ -17,6 +17,7 @@ package com.io7m.trasco.vanilla; import com.io7m.anethum.api.ParseStatus; +import com.io7m.jxe.core.JXEHardenedSAXParsers; import com.io7m.trasco.api.TrSchemaRevisionSetParserFactoryType; import com.io7m.trasco.api.TrSchemaRevisionSetParserType; import com.io7m.trasco.vanilla.internal.TrSchemaSetRevisionParser; @@ -44,7 +45,7 @@ public TrSchemaRevisionSetParsers() @Override public TrSchemaRevisionSetParserType createParserWithContext( - final Object context, + final JXEHardenedSAXParsers context, final URI source, final InputStream stream, final Consumer statusConsumer) @@ -53,6 +54,11 @@ public TrSchemaRevisionSetParserType createParserWithContext( Objects.requireNonNull(stream, "stream"); Objects.requireNonNull(statusConsumer, "statusConsumer"); - return new TrSchemaSetRevisionParser(source, stream, statusConsumer); + return new TrSchemaSetRevisionParser( + Objects.requireNonNullElse(context, new JXEHardenedSAXParsers()), + source, + stream, + statusConsumer + ); } } diff --git a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/TrSchemaSetRevisionParser.java b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/TrSchemaSetRevisionParser.java index 4142f70..264eba0 100644 --- a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/TrSchemaSetRevisionParser.java +++ b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/TrSchemaSetRevisionParser.java @@ -24,6 +24,8 @@ import com.io7m.blackthorne.core.BTParseError; import com.io7m.blackthorne.core.BTPreserveLexical; import com.io7m.blackthorne.jxe.BlackthorneJXE; +import com.io7m.jxe.core.JXEHardenedSAXParsers; +import com.io7m.jxe.core.JXEXInclude; import com.io7m.trasco.api.TrSchemaRevisionSet; import com.io7m.trasco.api.TrSchemaRevisionSetParserType; import com.io7m.trasco.vanilla.internal.v1.TrV1SchemaDeclSetParser; @@ -35,6 +37,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -50,20 +53,25 @@ public final class TrSchemaSetRevisionParser private final URI source; private final InputStream stream; private final Consumer statusConsumer; + private final JXEHardenedSAXParsers parsers; /** * A parser of revision sets. * + * @param inParsers The SAX parser provider + * @param inSource The source * @param inStream The stream * @param inStatusConsumer A status consumer - * @param inSource The source */ public TrSchemaSetRevisionParser( + final JXEHardenedSAXParsers inParsers, final URI inSource, final InputStream inStream, final Consumer inStatusConsumer) { + this.parsers = + Objects.requireNonNull(inParsers, "inParsers"); this.source = Objects.requireNonNull(inSource, "source"); this.stream = @@ -96,7 +104,7 @@ public TrSchemaRevisionSet execute() { try { final TrSchemaRevisionSet schemas = - BlackthorneJXE.parse( + BlackthorneJXE.parseAll( this.source, this.stream, Map.ofEntries( @@ -105,8 +113,11 @@ public TrSchemaRevisionSet execute() TrV1SchemaDeclSetParser::new ) ), - TrSchemas.schemas(), - BTPreserveLexical.PRESERVE_LEXICAL_INFORMATION + this.parsers, + Optional.empty(), + JXEXInclude.XINCLUDE_DISABLED, + BTPreserveLexical.PRESERVE_LEXICAL_INFORMATION, + TrSchemas.schemas() ); return schemas; diff --git a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/package-info.java b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/package-info.java index 54e3155..b7d3fed 100644 --- a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/package-info.java +++ b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/internal/package-info.java @@ -18,7 +18,7 @@ * SQL revision system (Vanilla implementation [internals]) */ -@Version("1.0.0") +@Version("2.0.0") package com.io7m.trasco.vanilla.internal; import org.osgi.annotation.versioning.Version; diff --git a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/package-info.java b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/package-info.java index 5984fba..626fd6f 100644 --- a/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/package-info.java +++ b/com.io7m.trasco.vanilla/src/main/java/com/io7m/trasco/vanilla/package-info.java @@ -19,7 +19,7 @@ */ @Export -@Version("1.0.0") +@Version("2.0.0") package com.io7m.trasco.vanilla; import org.osgi.annotation.bundle.Export; diff --git a/com.io7m.trasco.vanilla/src/main/java/module-info.java b/com.io7m.trasco.vanilla/src/main/java/module-info.java index 2c43abf..89e1596 100644 --- a/com.io7m.trasco.vanilla/src/main/java/module-info.java +++ b/com.io7m.trasco.vanilla/src/main/java/module-info.java @@ -23,8 +23,7 @@ requires static org.osgi.annotation.bundle; requires static org.osgi.annotation.versioning; - requires transitive com.io7m.trasco.api; - + requires com.io7m.trasco.api; requires com.io7m.trasco.xml.schemas; requires com.io7m.anethum.api; @@ -32,6 +31,7 @@ requires com.io7m.blackthorne.jxe; requires com.io7m.junreachable.core; requires com.io7m.jxe.core; + requires java.sql; requires org.apache.commons.text; requires org.slf4j; diff --git a/com.io7m.trasco.xml.schemas/pom.xml b/com.io7m.trasco.xml.schemas/pom.xml index 4799d7a..03542bc 100644 --- a/com.io7m.trasco.xml.schemas/pom.xml +++ b/com.io7m.trasco.xml.schemas/pom.xml @@ -9,7 +9,7 @@ com.io7m.trasco com.io7m.trasco - 2.0.2-SNAPSHOT + 3.0.0-SNAPSHOT com.io7m.trasco.xml.schemas diff --git a/pom.xml b/pom.xml index e3a073b..30378a2 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ com.io7m.trasco com.io7m.trasco - 2.0.2-SNAPSHOT + 3.0.0-SNAPSHOT pom com.io7m.trasco