Skip to content

Commit

Permalink
[#389] javax to jakarta conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrpav committed Sep 14, 2023
1 parent 153286f commit a57e17c
Show file tree
Hide file tree
Showing 412 changed files with 802 additions and 805 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/maven-build-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'temurin'

- name: Maven with JDK 8
run: mvn -Pall -no-transfer-progress clean install

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Please refer to the [wiki](https://github.com/highsource/jaxb-tools/wiki/Annox-H
// Parse annotation from the string
XAnnotation<XmlRootElement> xannotation =
(XAnnotation<XmlRootElement>) XAnnotationParser.INSTANCE.parse
("@javax.xml.bind.annotation.XmlRootElement(name=\"foo\")");
("@jakarta.xml.bind.annotation.XmlRootElement(name=\"foo\")");

// Create an instance of the annotation
XmlRootElement xmlRootElement = xannotation.getResult();
Expand Down Expand Up @@ -188,8 +188,8 @@ You can put your annotations directly in schema:
````xml
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.1"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
jaxb:version="3.0"
xmlns:annox="http://annox.dev.java.net"
jaxb:extensionBindingPrefixes="annox">

Expand Down Expand Up @@ -239,7 +239,7 @@ Or in binding files:
````xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="http://annox.dev.java.net"
Expand All @@ -249,7 +249,7 @@ Or in binding files:

<jaxb:bindings schemaLocation="schema.xsd" node="/xs:schema">
<jaxb:bindings node="xs:complexType[@name='issueJIIB39CType']">
<annox:annotateClass>@javax.xml.bind.annotation.XmlRootElement(name="IssueJIIB39CType")</annox:annotateClass>
<annox:annotateClass>@jakarta.xml.bind.annotation.XmlRootElement(name="IssueJIIB39CType")</annox:annotateClass>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name='issueJIIB39CType']/xs:attribute[@name='test']">
<annox:annotate target="field">@javax.xml.bind.annotation.XmlAttribute(required=false, name="test")</annox:annotate>
Expand Down Expand Up @@ -299,23 +299,23 @@ You can remove annotations using customizations directly in schema:
````xml
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.1"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
jaxb:version="3.0"
xmlns:annox="http://annox.dev.java.net"
jaxb:extensionBindingPrefixes="annox">

<xsd:complexType name="FooType">
<xsd:annotation>
<xsd:appinfo>
<annox:removeAnnotation class="javax.xml.bind.annotation.XmlType" />
<annox:removeAnnotation class="jakarta.xml.bind.annotation.XmlType" />
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="bar" type="xsd:string"/>
<xsd:element name="foobar" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<annox:removeAnnotation class="javax.xml.bind.annotation.XmlElement" target="field" />
<annox:removeAnnotation class="jakarta.xml.bind.annotation.XmlElement" target="field" />
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand All @@ -330,7 +330,7 @@ Or in binding files:
````xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="http://annox.dev.java.net"
Expand All @@ -340,10 +340,10 @@ Or in binding files:

<jaxb:bindings schemaLocation="schema.xsd" node="/xs:schema">
<jaxb:bindings node="xs:complexType[@name='FooType']">
<annox:removeAnnotation class="javax.xml.bind.annotation.XmlType" />
<annox:removeAnnotation class="jakarta.xml.bind.annotation.XmlType" />
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name='FooType']//xs:element[@name='foobar']">
<annox:removeAnnotation class="javax.xml.bind.annotation.XmlElement" target="field" />
<annox:removeAnnotation class="jakarta.xml.bind.annotation.XmlElement" target="field" />
</jaxb:bindings>
</jaxb:bindings>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Map;
import java.util.Map.Entry;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.apache.commons.lang3.Validate;
import org.jvnet.jaxb2_commons.codemodel.JCMType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.apache.commons.lang3.Validate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.jvnet.jaxb2_commons.codemodel.JConditionable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jvnet.jaxb2_commons.plugin.inheritance;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import javax.xml.namespace.QName;

import org.jvnet.jaxb2_commons.util.CustomizationUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.jvnet.jaxb2_commons.plugin.inheritance;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlValue;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@XmlRootElement(namespace = "http://jaxb2-commons.dev.java.net/basic/inheritance", name = "extends")
@XmlAccessorType(XmlAccessType.PROPERTY)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.jvnet.jaxb2_commons.plugin.inheritance;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlValue;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@XmlRootElement(namespace = "http://jaxb2-commons.dev.java.net/basic/inheritance", name = "implements")
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.plugin.inheritance;

import javax.xml.bind.annotation.XmlRegistry;
import jakarta.xml.bind.annotation.XmlRegistry;

@XmlRegistry
public class ObjectFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlRootElement(namespace = "http://jaxb2-commons.dev.java.net/basic/inheritance", name = "objectFactory")
@XmlType(propOrder = { "extendsClass", "implementsInterface" })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jvnet.jaxb2_commons.plugin.namespace_prefix;

import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlSchema;
import jakarta.xml.bind.annotation.XmlNs;
import jakarta.xml.bind.annotation.XmlSchema;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import com.sun.tools.xjc.model.CTypeRef;
import com.sun.tools.xjc.model.CValuePropertyInfo;
import com.sun.tools.xjc.model.Model;
import com.sun.xml.bind.v2.model.core.ID;
import org.glassfish.jaxb.core.v2.model.core.ID;

public class SimplifyPlugin extends AbstractParameterizablePlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.sun.tools.xjc.model.CPropertyInfo;
import com.sun.tools.xjc.model.CReferencePropertyInfo;
import com.sun.tools.xjc.model.Model;
import com.sun.xml.bind.v2.model.core.WildcardMode;
import org.glassfish.jaxb.core.v2.model.core.WildcardMode;

public class WildcardPlugin extends AbstractParameterizablePlugin {

Expand Down
2 changes: 1 addition & 1 deletion basics/basic/src/test/resources/schema.xsd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
jaxb:version="1.0">

<xs:annotation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.io.StringWriter;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;

public class ContextUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.w3c.dom.Node;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Iterator;
import java.util.List;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.jvnet.jaxb2_commons.locator.ObjectLocator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.util.List;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.jvnet.jaxb2_commons.locator.ObjectLocator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.lang;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;

import org.jvnet.jaxb2_commons.locator.ObjectLocator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.locator;

import javax.xml.bind.ValidationEventLocator;
import jakarta.xml.bind.ValidationEventLocator;

import org.jvnet.jaxb2_commons.i18n.Reportable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.xml.bind;

import javax.xml.bind.Marshaller;
import jakarta.xml.bind.Marshaller;

public interface AfterMarshallCallback {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.xml.bind;

import javax.xml.bind.Unmarshaller;
import jakarta.xml.bind.Unmarshaller;

public interface AfterUnmarshallCallback {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.xml.bind;

import javax.xml.bind.Marshaller;
import jakarta.xml.bind.Marshaller;

public interface BeforeMarshallCallback {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.jaxb2_commons.xml.bind;

import javax.xml.bind.Unmarshaller;
import jakarta.xml.bind.Unmarshaller;

public interface BeforeUnmarshallCallback {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;

import org.jvnet.jaxb2_commons.lang.StringUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.jvnet.jaxb2_commons.xml.bind.model.concrete.origin.PropertyInfoOrigin;
import org.jvnet.jaxb2_commons.xml.bind.model.origin.MClassInfoOrigin;

import com.sun.xml.bind.v2.model.core.ClassInfo;
import com.sun.xml.bind.v2.model.core.PropertyInfo;
import org.glassfish.jaxb.core.v2.model.core.ClassInfo;
import org.glassfish.jaxb.core.v2.model.core.PropertyInfo;

public class CMClassInfo<T, C extends T> implements MClassInfo<T, C> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.jvnet.jaxb2_commons.xml.bind.model.concrete.origin.EnumLeafInfoOrigin;
import org.jvnet.jaxb2_commons.xml.bind.model.origin.MEnumLeafInfoOrigin;

import com.sun.xml.bind.v2.model.core.EnumConstant;
import com.sun.xml.bind.v2.model.core.EnumLeafInfo;
import org.glassfish.jaxb.core.v2.model.core.EnumConstant;
import org.glassfish.jaxb.core.v2.model.core.EnumLeafInfo;

public class CMEnumLeafInfo<T, C extends T> implements MEnumLeafInfo<T, C>,
MCustomizable {
Expand Down
Loading

0 comments on commit a57e17c

Please sign in to comment.