From bc4ce73b56514928742c643e02e22bffedc63607 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Thu, 11 Aug 2022 04:17:48 +0100 Subject: [PATCH] Declare osgi.serviceloader.registrar requirement as optional. (#155) --- src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java | 4 +++- src/main/java/com/ctc/wstx/msv/RelaxNGSchemaFactory.java | 4 +++- src/main/java/com/ctc/wstx/msv/W3CSchemaFactory.java | 4 +++- src/main/java/com/ctc/wstx/stax/WstxEventFactory.java | 4 +++- src/main/java/com/ctc/wstx/stax/WstxInputFactory.java | 4 +++- src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java b/src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java index 660177c3..60517fa9 100644 --- a/src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java +++ b/src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java @@ -32,6 +32,8 @@ import com.ctc.wstx.util.SymbolTable; import com.ctc.wstx.util.URLUtil; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + /** * Factory for creating DTD validator schema objects (shareable stateless * "blueprints" for creating actual validators). @@ -41,7 +43,7 @@ * documents) is only accessible by core Woodstox. The externally * accessible */ -@ServiceProvider(XMLValidationSchemaFactory.class) +@ServiceProvider(value = XMLValidationSchemaFactory.class, resolution = OPTIONAL) public class DTDSchemaFactory extends XMLValidationSchemaFactory { diff --git a/src/main/java/com/ctc/wstx/msv/RelaxNGSchemaFactory.java b/src/main/java/com/ctc/wstx/msv/RelaxNGSchemaFactory.java index 30cfba34..fb7a0494 100644 --- a/src/main/java/com/ctc/wstx/msv/RelaxNGSchemaFactory.java +++ b/src/main/java/com/ctc/wstx/msv/RelaxNGSchemaFactory.java @@ -27,6 +27,8 @@ import com.sun.msv.reader.GrammarReaderController; import com.sun.msv.reader.trex.ng.RELAXNGReader; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + /** * This is a StAX2 schema factory that can parse and create schema instances * for creating validators that validate documents to check their validity @@ -36,7 +38,7 @@ * to work, and acts as a quite thin wrapper layer (although not a completely * trivial one, since MSV only exports SAX API, some adapting is needed) */ -@ServiceProvider(XMLValidationSchemaFactory.class) +@ServiceProvider(value = XMLValidationSchemaFactory.class, resolution = OPTIONAL) public class RelaxNGSchemaFactory extends BaseSchemaFactory { diff --git a/src/main/java/com/ctc/wstx/msv/W3CSchemaFactory.java b/src/main/java/com/ctc/wstx/msv/W3CSchemaFactory.java index 30de0813..0522ab1d 100644 --- a/src/main/java/com/ctc/wstx/msv/W3CSchemaFactory.java +++ b/src/main/java/com/ctc/wstx/msv/W3CSchemaFactory.java @@ -27,6 +27,8 @@ import com.sun.msv.reader.GrammarReaderController; import com.sun.msv.reader.xmlschema.XMLSchemaReader; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + /** * This is a StAX2 schema factory that can parse and create schema instances * for creating validators that validate documents to check their validity @@ -36,7 +38,7 @@ * to work, and acts as a quite thin wrapper layer, similar to * how matching RelaxNG validator works */ -@ServiceProvider(XMLValidationSchemaFactory.class) +@ServiceProvider(value = XMLValidationSchemaFactory.class, resolution = OPTIONAL) public class W3CSchemaFactory extends BaseSchemaFactory { diff --git a/src/main/java/com/ctc/wstx/stax/WstxEventFactory.java b/src/main/java/com/ctc/wstx/stax/WstxEventFactory.java index f19adf1d..a2bb1a42 100644 --- a/src/main/java/com/ctc/wstx/stax/WstxEventFactory.java +++ b/src/main/java/com/ctc/wstx/stax/WstxEventFactory.java @@ -28,11 +28,13 @@ import com.ctc.wstx.compat.QNameCreator; import com.ctc.wstx.evt.*; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + /** * Implementation of {@link XMLEventFactory} to be used with * Woodstox. Contains minimal additions on top of Stax2 RI. */ -@ServiceProvider(XMLEventFactory.class) +@ServiceProvider(value = XMLEventFactory.class, resolution = OPTIONAL) public final class WstxEventFactory extends Stax2EventFactoryImpl { diff --git a/src/main/java/com/ctc/wstx/stax/WstxInputFactory.java b/src/main/java/com/ctc/wstx/stax/WstxInputFactory.java index 2de47385..10d3963e 100644 --- a/src/main/java/com/ctc/wstx/stax/WstxInputFactory.java +++ b/src/main/java/com/ctc/wstx/stax/WstxInputFactory.java @@ -54,6 +54,8 @@ import com.ctc.wstx.util.SymbolTable; import com.ctc.wstx.util.URLUtil; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + /** * Factory for creating various Stax objects (stream/event reader, * writer). @@ -69,7 +71,7 @@ * * @author Tatu Saloranta */ -@ServiceProvider(XMLInputFactory.class) +@ServiceProvider(value = XMLInputFactory.class, resolution = OPTIONAL) public class WstxInputFactory extends XMLInputFactory2 implements ReaderCreator, diff --git a/src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java b/src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java index 16221ac4..df3d68b6 100644 --- a/src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java +++ b/src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java @@ -52,6 +52,8 @@ import com.ctc.wstx.sw.XmlWriter; import com.ctc.wstx.util.URLUtil; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + /** * Implementation of {@link XMLOutputFactory} for Wstx. *

@@ -62,7 +64,7 @@ * * */ -@ServiceProvider(XMLOutputFactory.class) +@ServiceProvider(value = XMLOutputFactory.class, resolution = OPTIONAL) public class WstxOutputFactory extends XMLOutputFactory2 implements OutputConfigFlags