Skip to content

Commit

Permalink
Upgrade Gradle and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed Dec 6, 2024
1 parent 30c4b70 commit cdbead7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
java = "17"
checkstyle = "10.18.2"
checkstyle = "10.20.2"
jacoco = "0.8.12"
junit = "5.11.2"
junit = "5.11.3"
spotbugs = "4.8.6"

[plugins]
cthingVersioning = { id = "org.cthing.cthing-versioning", version = "3.0.0" }
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.2.0" }
spotbugs = { id = "com.github.spotbugs", version = "6.0.25" }
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" }
spotbugs = { id = "com.github.spotbugs", version = "6.0.26" }
versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }

[libraries]
Expand All @@ -19,6 +19,6 @@ escapers = "org.cthing:escapers:2.0.0"
jspecify = "org.jspecify:jspecify:1.0.0"
junitApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.2"
junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.3"
junitParams = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.5"
spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.8"
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name = "xmlwriter"

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.8.0")
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.9.0")
}
17 changes: 15 additions & 2 deletions src/main/java/org/cthing/xmlwriter/XmlWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* terminate the XML document. No XML output methods can be called following the call to endDocument.</li>
* <li>Optionally, reuse the XmlWriter instance by calling the {@link #reset reset} method.</li>
* </ol>
*
* <p>The following is an example of using a standalone XmlWriter to write a simple XML document to the standard
* output:</p>
* <pre>
Expand All @@ -66,6 +67,7 @@
* w.endElement();
* w.endDocument();
* </pre>
*
* <p>The following XML is displayed on the standard output:</p>
* <pre>
* &lt;?xml version="1.0" standalone="yes"?&gt;
Expand All @@ -74,6 +76,7 @@
* </pre>
*
* <h2>SAX Filter Usage</h2>
*
* <p>The XmlWriter can be used as a SAX2 stream filter. The class receives SAX events from the downstream XMLReader,
* outputs the appropriate XML, and forwards the event to the upstream filter. For usage as a SAX filter:</p>
* <ol>
Expand All @@ -83,6 +86,7 @@
* method must be called on the outermost object in the filter chain.</li>
* <li>When used as part of a filter chain, the XmlWriter is not reused.</li>
* </ol>
*
* <p>In the following example, the XmlWriter is used to output XML that is being parsed by an
* {@link org.xml.sax.XMLReader XMLReader} and written to the standard output.</p>
* <pre>
Expand All @@ -98,14 +102,15 @@
* xmlWriter.setProperty("http://xml.org/sax/properties/lexical-handler", xmlWriter);
* xmlWriter.parse(new InputSource(new FileReader("Foo.xml")));
* </pre>
*
* <p>An XmlWriter can process more SAX events than those specified in the
* {@link org.xml.sax.helpers.XMLFilterImpl XMLFilterImpl} base class. Specifically, the XmlWriter can process
* the DTD, CDATA and comment events reported by the {@link org.xml.sax.ext.LexicalHandler LexicalHandler}
* interface. The call to {@link org.xml.sax.helpers.XMLFilterImpl#setProperty(java.lang.String, java.lang.Object)
* setProperty} in the above example, allows the XmlWriter to receive these additional events.</p>
*
* <p><strong>Note:</strong> When an XmlWriter is used in a SAX filter chain, the input XML header is not output.
* Instead a generic XML header is generated. See the {@link #startDocument() startDocument} and
* Instead, a generic XML header is generated. See the {@link #startDocument() startDocument} and
* {@link #setStandalone(boolean) setStandalone} methods for more information. In addition, internal DTD subsets are
* not output.</p>
*
Expand All @@ -121,13 +126,15 @@
* <pre>
* &lt;ns1:elem1 xmlns:ns1="https://www.cthing.com/foo"&gt;
* </pre>
*
* <p>In the above example, the element's qualified name is {@code ns1:elem1} consisting of the namespace prefix
* {@code ns1} and the local name {@code elem1}. The element is associated with the namespace URI
* {@code https://www.cthing.com/foo} using the namespace declaration attribute. An element belongs to the default
* namespace when the prefix is not specified:</p>
* <pre>
* &lt;elem1 xmlns="https://www.cthing.com/foo"&gt;
* </pre>
*
* <p>The XmlWriter provides many overloaded methods for writing elements and attributes with various combinations
* of namespace components: namespace URI, local name, and qualified name. The namespace URI is used to look up a
* prefix for the element. If a prefix cannot be found, but there is a prefix on the qualified name, that prefix is
Expand Down Expand Up @@ -163,6 +170,7 @@
* &lt;__NS1:elem3 xmlns:__NS1="https://www.cthing.com/foo"/&gt;
* &lt;/elem1&gt;
* </pre>
*
* <p>A more appropriate prefix can be specified using the {@link #addNSPrefix(String, String) addNSPrefix} method</p>
* <pre>
* addNSPrefix("n1", "https://www.cthing.com/foo");
Expand All @@ -176,6 +184,7 @@
* &lt;n1:elem3 xmlns:n1="https://www.cthing.com/foo"/&gt;
* &lt;/elem1&gt;
* </pre>
*
* <p>The addNSPrefix method specifies namespace prefixes, but as shown in the above example, the namespaces
* declarations appear on every element leading to nearly unreadable verbose XML. Typically, namespaces are declared
* once on the root element. To achieve this using the XmlWriter, call one of the
Expand All @@ -194,6 +203,7 @@
* &lt;ns1:elem3/&gt;
* &lt;/elem1&gt;
* </pre>
*
* <p>The default namespace can be specified by calling the addNSPrefix or addNSRootDecl method with an empty string
* ("") for the prefix as shown in the following example:</p>
* <pre>
Expand All @@ -210,6 +220,7 @@
* </pre>
*
* <h2>Pretty Printing</h2>
*
* <p>The XmlWriter can format the XML output and provides a number of options for controlling the appearance of the
* output.</p>
*
Expand All @@ -222,6 +233,7 @@
* &lt;?xml version="1.0" standalone="yes"?&gt;
* &lt;elem1&gt;&lt;elem2&gt;Hello World&lt;/elem2&gt;&lt;/elem1&gt;
* </pre>
*
* <p>results in this output:</p>
* <pre>
* &lt;?xml version="1.0" standalone="yes"?&gt;
Expand All @@ -234,10 +246,11 @@
* <p><strong>Pretty Printing Attributes -</strong> By default the XmlWriter writes element attributes on the same
* line as the element name. Call {@link #setAttrPerLine(boolean) setAttrPerLine} with a value of {@code true} to
* have each attribute written on a separate line. The formatting of attributes can be selected independently basic
* pretty printing. By default element attributes are written as:</p>
* pretty printing. By default, element attributes are written as:</p>
* <pre>
* &lt;elem1 a1="v1" a2="v2" a3="v3"/&gt;
* </pre>
*
* <p>Using attribute formatting, element attributes are written as:</p>
* <pre>
* &lt;elem1
Expand Down

0 comments on commit cdbead7

Please sign in to comment.