This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/commons-xml.git
commit 80c5a0a41725a8aa0f7f59227e6e3a616c22f107 Author: Gary Gregory <[email protected]> AuthorDate: Wed Aug 26 07:59:54 2026 -0400 Javadoc --- .../xml/FallbackIgnoreLSResourceResolver.java | 5 +++++ .../commons/xml/FallbackIgnoreURIResolver.java | 5 +++++ .../commons/xml/FallbackIgnoreXMLResolver.java | 20 +++++++++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java b/src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java index 3c0d764..3d99d64 100644 --- a/src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java +++ b/src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java @@ -88,6 +88,11 @@ public LSInput resolveResource(final String type, final String namespaceURI, fin return empty; } + /** + * Sets the delegate to consult first, replacing any previous delegate. A {@code null} value removes the delegate and leaves a pure ignore-all floor. + * + * @param delegate The delegate to consult first, or {@code null} for a pure ignore-all floor. + */ void setDelegate(final LSResourceResolver delegate) { this.delegate = delegate; } diff --git a/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java b/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java index edcd78f..21a4305 100644 --- a/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java +++ b/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java @@ -112,6 +112,11 @@ public Source resolve(final String href, final String base) throws TransformerEx return emptySource.get(); } + /** + * Sets the delegate to consult first, replacing any previous delegate. A {@code null} value removes the delegate and leaves a pure ignore-all floor. + * + * @param delegate The delegate to consult first, or {@code null} for a pure ignore-all floor. + */ void setDelegate(final URIResolver delegate) { this.delegate = delegate; } diff --git a/src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java b/src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java index b055a2a..12dd350 100644 --- a/src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java +++ b/src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java @@ -25,17 +25,18 @@ /** * {@link XMLResolver} floor: consults an optional caller-supplied resolver and ignores (resolves to empty) whatever the caller does not resolve. - * - * <p>The StAX counterpart of {@link FallbackIgnoreEntityResolver2}, installed on each entity-resolution hook. The hardened {@link javax.xml.stream.XMLInputFactory} - * wrapper routes a caller-set resolver through {@link #setDelegate} rather than letting it replace the floor. A caller opts a specific entity in by returning - * a non-{@code null} result; anything left unresolved resolves to an empty input, so the external resource is neither fetched nor leaked and the parse - * continues with no replacement content.</p> + * <p> + * The StAX counterpart of {@link FallbackIgnoreEntityResolver2}, installed on each entity-resolution hook. The hardened + * {@link javax.xml.stream.XMLInputFactory} wrapper routes a caller-set resolver through {@link #setDelegate} rather than letting it replace the floor. A caller + * opts a specific entity in by returning a non-{@code null} result; anything left unresolved resolves to an empty input, so the external resource is neither + * fetched nor leaked and the parse continues with no replacement content. + * </p> */ final class FallbackIgnoreXMLResolver implements XMLResolver { /** - * Empty {@link ByteArrayInputStream} shared across every call. {@code read()} on a zero-length array always returns {@code -1}, so reusing the instance - * is safe even though the type is technically stateful. + * Empty {@link ByteArrayInputStream} shared across every call. {@code read()} on a zero-length array always returns {@code -1}, so reusing the instance is + * safe even though the type is technically stateful. */ private static final InputStream EMPTY = new ByteArrayInputStream(new byte[0]); @@ -71,6 +72,11 @@ public Object resolveEntity(final String publicID, final String systemID, final return EMPTY; } + /** + * Sets the delegate to consult first, replacing any previous delegate, may be {@code null}. + * + * @param delegate The delegate to consult first, replacing any previous delegate. + */ void setDelegate(final XMLResolver delegate) { this.delegate = delegate; }
