Unverified Commit 0d19f8aa authored by Tomáš Kraus's avatar Tomáš Kraus Committed by GitHub
Browse files

Code cleanup. (#201)


* Fixed build link in README.
Signed-off-by: default avatarTomas Kraus <tomas.kraus@oracle.com>
parent 4449adaa
......@@ -6,10 +6,11 @@
[//]: # " "
[//]: # " SPDX-License-Identifier: BSD-3-Clause "
[![Build Status](https://travis-ci.com/eclipse-ee4j/jaxb-api.svg?branch=master)](https://travis-ci.com/eclipse-ee4j/jaxb-api)
# Jakarta XML Binding project
[![Build Status](https://github.com/eclipse-ee4j/jaxb-api/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/eclipse-ee4j/jaxb-api/actions/workflows/maven.yml?branch=master)
[![Jakarta Staging (Snapshots)](https://img.shields.io/nexus/s/https/jakarta.oss.sonatype.org/jakarta.xml.bind/jakarta.xml.bind-api.svg)](https://jakarta.oss.sonatype.org/content/repositories/staging/jakarta/xml/bind/jakarta.xml.bind-api/)
The Jakarta XML Binding provides an API and tools that automate the mapping
between XML documents and Java objects.
......
......@@ -27,6 +27,7 @@
<properties>
<config.dir>${project.basedir}/../etc/config</config.dir>
<legal.doc.source>${project.basedir}/..</legal.doc.source>
<spotbugs.exclude>${project.basedir}/../etc/spotbugs-exclude.xml</spotbugs.exclude>
</properties>
<dependencies>
......@@ -63,18 +64,6 @@
<revisionOnScmFailure>false</revisionOnScmFailure>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<threshold>${spotbugs.threshold}</threshold>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<excludeFilterFile>
${spotbugs.exclude}
</excludeFilterFile>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
......@@ -207,6 +196,8 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
<compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
<executions>
<execution>
......@@ -281,6 +272,23 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
</archive>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<fork>true</fork>
<excludeFilterFile>${spotbugs.exclude}</excludeFilterFile>
<failThreshold>High</failThreshold>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -50,7 +50,7 @@ import javax.xml.validation.Schema;
* {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
*
* <p>
* The template parameter, <code>XmlNode</code>, is the
* @param <XmlNode> the template parameter, <code>XmlNode</code>, is the
* root interface/class for the XML infoset preserving representation.
* A Binder implementation is required to minimally support
* an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>.
......@@ -130,6 +130,7 @@ public abstract class Binder<XmlNode> {
* the document/element to unmarshal XML data from.
* @param declaredType
* appropriate Jakarta XML Binding mapped class to hold {@code node}'s XML data.
* @param <T> the declared type
*
* @return
* <a href="JAXBElement.html">JAXBElement</a> representation
......@@ -224,6 +225,8 @@ public abstract class Binder<XmlNode> {
* have associated Jakarta XML Binding objects, and not all Jakarta XML Binding objects have
* associated XML elements.
*
* @param xmlNode the XML element
*
* @return
* null if the specified XML node is not known to this
* {@link Binder}, or if it is not associated with a
......@@ -244,6 +247,10 @@ public abstract class Binder<XmlNode> {
* updateXML( jaxbObject, getXMLNode(jaxbObject));
* </pre>
*
* @param jaxbObject the XML Binding object
*
* @return the XML node associated with XML Binding object
*
* @throws JAXBException
* If any unexpected problem occurs updating corresponding XML content.
* @throws IllegalArgumentException
......@@ -298,6 +305,8 @@ public abstract class Binder<XmlNode> {
* As a side-effect, this operation updates the association between
* XML nodes and Jakarta XML Binding objects.
*
* @param xmlNode the XML node
*
* @return
* Returns the updated Jakarta XML Binding object. Typically, this is the same
* object that was returned from earlier
......
......@@ -234,6 +234,10 @@ public abstract class JAXBContext {
* {@link #newInstance(String,ClassLoader)} method with
* the context class loader of the current thread.
*
* @param contextPath the context path
*
* @return the new instance of a {@code JAXBContext} class
*
* @throws JAXBException if an error was encountered while creating the
* {@code JAXBContext} such as
* <ol>
......@@ -624,7 +628,9 @@ public abstract class JAXBContext {
* Creates a {@code Binder} object that can be used for
* associative/in-place unmarshalling/marshalling.
*
* @param domType select the DOM API to use by passing in its DOM Node class.
* @param domType select the DOM API to use by passing in its DOM Node class
*
* @param <T> the DOM API type
*
* @return always a new valid {@code Binder} object.
*
......@@ -697,12 +703,8 @@ public abstract class JAXBContext {
return Thread.currentThread().getContextClassLoader();
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
(java.security.PrivilegedAction<ClassLoader>) ()
-> Thread.currentThread().getContextClassLoader());
}
}
......
......@@ -634,6 +634,12 @@ public interface Marshaller {
* <p>
* This is a convenience method that invokes {@code setAdapter(adapter.getClass(),adapter);}.
*
* @param adapter
* The instance of the adapter to be used. If null, it will un-register
* the current adapter set for this type.
*
* @param <A> the type of the adapter
*
* @see #setAdapter(Class,XmlAdapter)
* @throws IllegalArgumentException
* if the adapter parameter is null.
......@@ -664,6 +670,8 @@ public interface Marshaller {
* @param adapter
* The instance of the adapter to be used. If null, it will un-register
* the current adapter set for this type.
* @param <A> the type of the adapter
*
* @throws IllegalArgumentException
* if the type parameter is null.
* @throws UnsupportedOperationException
......@@ -674,9 +682,18 @@ public interface Marshaller {
/**
* Gets the adapter associated with the specified type.
*
* This is the reverse operation of the {@link #setAdapter} method.
*
* @param type
* The type of the adapter. The specified instance will be used when
* {@link jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
* refers to this type.
*
* @param <A> the type of the adapter
*
* @return
* The adapter associated with the specified type.
*
* @throws IllegalArgumentException
* if the type parameter is null.
* @throws UnsupportedOperationException
......@@ -687,11 +704,13 @@ public interface Marshaller {
/**
* <p>Associate a context that enables binary data within an XML document
* Associate a context that enables binary data within an XML document
* to be transmitted as XML-binary optimized attachment.
* The attachment is referenced from the XML document content model
* by content-id URIs(cid) references stored within the xml document.
*
* @param am the attachment marshaller to be set
*
* @throws IllegalStateException if attempt to concurrently call this
* method during a marshal operation.
*/
......
......@@ -540,6 +540,8 @@ public interface Unmarshaller {
* @param declaredType
* appropriate Jakarta XML Binding mapped class to hold {@code node}'s XML data.
*
* @param <T> the XML Binding mapped class
*
* @return <a href="#unmarshalDeclaredTypeReturn">JAXBElement</a> representation of {@code node}
*
* @throws JAXBException
......@@ -629,6 +631,9 @@ public interface Unmarshaller {
* only required to support SAXSource, DOMSource, and StreamSource)
* @param declaredType
* appropriate Jakarta XML Binding mapped class to hold {@code source}'s xml root element
*
* @param <T> the XML Binding mapped class
*
* @return Java content rooted by <a href="#unmarshalDeclaredTypeReturn">JAXBElement</a>
*
* @throws JAXBException
......@@ -700,6 +705,8 @@ public interface Unmarshaller {
* @param declaredType
* appropriate Jakarta XML Binding mapped class to hold {@code reader}'s START_ELEMENT XML data.
*
* @param <T> the XML Binding mapped class
*
* @return content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXBElement</a> representation
*
* @throws JAXBException
......@@ -771,6 +778,8 @@ public interface Unmarshaller {
* @param declaredType
* appropriate Jakarta XML Binding mapped class to hold {@code reader}'s START_ELEMENT XML data.
*
* @param <T> the XML Binding mapped class
*
* @return content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXBElement</a> representation
*
* @throws JAXBException
......@@ -912,6 +921,10 @@ public interface Unmarshaller {
* <p>
* This is a convenience method that invokes {@code setAdapter(adapter.getClass(),adapter);}.
*
* @param adapter the configured instance of {@link XmlAdapter}
*
* @param <A> the type of {@link XmlAdapter}
*
* @see #setAdapter(Class,XmlAdapter)
* @throws IllegalArgumentException
* if the adapter parameter is null.
......@@ -942,6 +955,9 @@ public interface Unmarshaller {
* @param adapter
* The instance of the adapter to be used. If null, it will un-register
* the current adapter set for this type.
*
* @param <A> the type of the adapter
*
* @throws IllegalArgumentException
* if the type parameter is null.
* @throws UnsupportedOperationException
......@@ -952,9 +968,19 @@ public interface Unmarshaller {
/**
* Gets the adapter associated with the specified type.
*
* This is the reverse operation of the {@link #setAdapter} method.
*
*
* @param type
* The type of the adapter. The specified instance will be used when
* {@link jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
* refers to this type.
*
* @param <A> the type of the adapter
*
* @return
* The adapter associated with the specified type.
*
* @throws IllegalArgumentException
* if the type parameter is null.
* @throws UnsupportedOperationException
......@@ -964,11 +990,12 @@ public interface Unmarshaller {
public <A extends XmlAdapter<?, ?>> A getAdapter( Class<A> type );
/**
* <p>Associate a context that resolves cid's, content-id URIs, to
* binary data passed as attachments.</p>
* <p>Unmarshal time validation, enabled via {@link #setSchema(Schema)},
* Associate a context that resolves cid's, content-id URIs, to
* binary data passed as attachments.
* Unmarshal time validation, enabled via {@link #setSchema(Schema)},
* must be supported even when unmarshaller is performing XOP processing.
* </p>
*
* @param au the attachment unmarshaller to be set
*
* @throws IllegalStateException if attempt to concurrently call this
* method during a unmarshal operation.
......
File moved
......@@ -18,7 +18,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
<relativePath/>
</parent>
......@@ -74,10 +74,9 @@
<copyright.scmonly>true</copyright.scmonly>
<copyright.templatefile>${config.dir}/edl-copyright.txt</copyright.templatefile>
<copyright.update>false</copyright.update>
<spotbugs.exclude>${project.basedir}/exclude.xml</spotbugs.exclude>
<spotbugs.skip>false</spotbugs.skip>
<spotbugs.threshold>Low</spotbugs.threshold>
<spotbugs.version>4.2.0</spotbugs.version>
<spotbugs.version>4.3.0</spotbugs.version>
<release.spec.feedback>jaxb-dev@eclipse.org</release.spec.feedback>
<release.spec.date>Jul 2017</release.spec.date>
......@@ -127,15 +126,15 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
......@@ -165,7 +164,7 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
......@@ -173,6 +172,7 @@
<version>${spotbugs.version}</version>
<configuration>
<skip>${spotbugs.skip}</skip>
<threshold>${spotbugs.threshold}</threshold>
</configuration>
</plugin>
</plugins>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment