Skip to content

Commit d5cf83f

Browse files
authored
Merge branch 'master' into 2.0.0-RC2
2 parents c544651 + 25d5e02 commit d5cf83f

File tree

464 files changed

+25346
-16523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

464 files changed

+25346
-16523
lines changed

.github/workflows/maven.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License v. 2.0, which is available at
6+
# http://www.eclipse.org/legal/epl-2.0.
7+
#
8+
# This Source Code may also be made available under the following Secondary
9+
# Licenses when the conditions for such availability set forth in the
10+
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
# version 2 with the GNU Classpath Exception, which is available at
12+
# https://www.gnu.org/software/classpath/license.html.
13+
#
14+
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
#
16+
17+
name: JSON-B API
18+
19+
on: [push, pull_request]
20+
21+
jobs:
22+
build:
23+
name: JSON-B API compilation
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout for build
28+
uses: actions/checkout@v2.3.4
29+
with:
30+
fetch-depth: 0
31+
- name: Set up compile JDK
32+
uses: actions/setup-java@v2
33+
with:
34+
distribution: 'adopt'
35+
java-version: 11
36+
- name: Maven cache
37+
uses: actions/cache@v2
38+
env:
39+
cache-name: maven-cache
40+
with:
41+
path:
42+
~/.m2
43+
key: build-${{ env.cache-name }}
44+
- name: API compilation
45+
run: cd api && mvn clean install
46+
- name: TCK test compilation
47+
run: cd tck && mvn clean install
48+
- name: Javadoc compilation
49+
run: cd docs && mvn clean install
50+
- name: Generating specification
51+
run: cd spec && mvn clean install

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/jakarta.json.bind/jakarta.json.bind-api.svg?label=Maven%20Central)](https://mvnrepository.com/artifact/jakarta.json.bind/jakarta.json.bind-api)
44
[![Javadoc](https://javadoc.io/badge2/jakarta.json.bind/jakarta.json.bind-api/javadoc.io.svg)](https://javadoc.io/doc/jakarta.json.bind/jakarta.json.bind-api)
5-
[![Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/jakarta.json.bind/jakarta.json.bind-api.svg?label=Snapshots)](https://oss.sonatype.org/content/repositories/snapshots/jakarta/json/bind/jakarta.json.bind-api/)
5+
[![Snapshots](https://img.shields.io/nexus/s/https/jakarta.oss.sonatype.org/jakarta.json.bind/jakarta.json.bind-api.svg?label=Snapshots)](https://jakarta.oss.sonatype.org/content/repositories/staging/jakarta/json/bind/jakarta.json.bind-api/)
66
[![Gitter](https://badges.gitter.im/eclipse/jsonb.svg)](https://gitter.im/eclipse/jsonb)
77
[![License](https://img.shields.io/badge/License-EPL%202.0-green.svg)](https://opensource.org/licenses/EPL-2.0)
88

@@ -16,7 +16,7 @@ JSON-B is a standard binding layer for converting Java objects to/from JSON mess
1616
<dependency>
1717
<groupId>jakarta.json.bind</groupId>
1818
<artifactId>jakarta.json.bind-api</artifactId>
19-
<version>1.0.1</version>
19+
<version>2.0.0</version>
2020
</dependency>
2121
```
2222

@@ -61,7 +61,7 @@ include the TCK module and apply the appropriate Arquillian container. See the [
6161

6262
- [Official web site](https://eclipse-ee4j.github.io/jsonb-api)
6363
- [Eclipse project](https://projects.eclipse.org/projects/ee4j.jsonb)
64-
- [User's Guide](http://json-b.net/docs/user-guide.html)
64+
- [User's Guide](https://eclipse-ee4j.github.io/jsonb-api/docs/user-guide.html)
6565
- [Jenkins Builds](https://ci.eclipse.org/jsonb/view/all/)
6666
- [Mailing list](https://www.eclipse.org/lists/jsonb-dev/)
6767
- [Yasson (Compatible Implementation)](https://github.com/eclipse-ee4j/yasson)

api/pom.xml

Lines changed: 17 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -23,12 +23,12 @@
2323
<parent>
2424
<groupId>org.eclipse.ee4j</groupId>
2525
<artifactId>project</artifactId>
26-
<version>1.0.6</version>
26+
<version>1.0.7</version>
2727
</parent>
2828

2929
<groupId>jakarta.json.bind</groupId>
3030
<artifactId>jakarta.json.bind-api</artifactId>
31-
<version>2.0.1-SNAPSHOT</version>
31+
<version>3.0.0-SNAPSHOT</version>
3232
<packaging>jar</packaging>
3333

3434
<name>JSON-B API</name>
@@ -86,13 +86,13 @@
8686
<release.spec.feedback>jsonb-dev@eclipse.org</release.spec.feedback>
8787
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8888
<milestone.number>01</milestone.number>
89-
<new.spec.version>2.0.0</new.spec.version>
89+
<new.spec.version>3.0.0</new.spec.version>
9090
<non.final>false</non.final>
9191
<skip.release.tests>false</skip.release.tests>
92-
<spec.version>2.0</spec.version>
93-
<jakarta.json.version>2.0.0-RC1</jakarta.json.version>
92+
<spec.version>3.0</spec.version>
93+
<jakarta.json.version>2.0.1</jakarta.json.version>
9494
<!-- The version of JSON-B API to compare against to verify we follow semantic versioning rules -->
95-
<baseline.compare.version>1.0.2</baseline.compare.version>
95+
<baseline.compare.version>2.0.0</baseline.compare.version>
9696
<api_package>jakarta.json.bind</api_package>
9797
<legal.doc.source>${project.basedir}/..</legal.doc.source>
9898
<vendor.name>Oracle Corporation</vendor.name>
@@ -108,7 +108,7 @@
108108
<dependency>
109109
<groupId>junit</groupId>
110110
<artifactId>junit</artifactId>
111-
<version>4.12</version>
111+
<version>4.13.1</version>
112112
<scope>test</scope>
113113
</dependency>
114114
</dependencies>
@@ -127,57 +127,6 @@
127127
</dependencies>
128128

129129
<profiles>
130-
<profile>
131-
<id>jdk11</id>
132-
<activation>
133-
<jdk>[11,)</jdk>
134-
</activation>
135-
<build>
136-
<plugins>
137-
<plugin>
138-
<groupId>org.apache.maven.plugins</groupId>
139-
<artifactId>maven-compiler-plugin</artifactId>
140-
<executions>
141-
<execution>
142-
<id>jdk-11</id>
143-
<goals>
144-
<goal>compile</goal>
145-
</goals>
146-
<configuration>
147-
<source>9</source>
148-
<target>9</target>
149-
<includes>
150-
<include>module-info.java</include>
151-
</includes>
152-
</configuration>
153-
</execution>
154-
</executions>
155-
</plugin>
156-
</plugins>
157-
</build>
158-
</profile>
159-
<profile>
160-
<id>jdk8</id>
161-
<activation>
162-
<jdk>(,9)</jdk>
163-
</activation>
164-
<build>
165-
<plugins>
166-
<plugin>
167-
<groupId>org.apache.maven.plugins</groupId>
168-
<artifactId>maven-checkstyle-plugin</artifactId>
169-
</plugin>
170-
<plugin>
171-
<groupId>org.codehaus.mojo</groupId>
172-
<artifactId>findbugs-maven-plugin</artifactId>
173-
</plugin>
174-
<plugin>
175-
<groupId>org.apache.maven.plugins</groupId>
176-
<artifactId>maven-javadoc-plugin</artifactId>
177-
</plugin>
178-
</plugins>
179-
</build>
180-
</profile>
181130
<profile>
182131
<id>final</id>
183132
<activation>
@@ -252,34 +201,8 @@
252201
<compilerArgs>
253202
<arg>-Xlint:all</arg>
254203
</compilerArgs>
204+
<release>11</release>
255205
</configuration>
256-
<executions>
257-
<execution>
258-
<id>default-compile</id>
259-
<configuration>
260-
<release>11</release>
261-
</configuration>
262-
</execution>
263-
<execution>
264-
<id>base-compile</id>
265-
<goals>
266-
<goal>compile</goal>
267-
</goals>
268-
<!-- recompile everything for 1.8 except the module-info.java -->
269-
<configuration>
270-
<release>8</release>
271-
<excludes>
272-
<exclude>module-info.java</exclude>
273-
</excludes>
274-
</configuration>
275-
</execution>
276-
<execution>
277-
<id>default-testCompile</id>
278-
<configuration>
279-
<release>11</release>
280-
</configuration>
281-
</execution>
282-
</executions>
283206
</plugin>
284207
<plugin>
285208
<!-- This plugin generates the buildNumber property used in maven-bundle-plugin -->
@@ -377,23 +300,23 @@
377300
<artifactId>maven-javadoc-plugin</artifactId>
378301
<version>3.1.0</version>
379302
<configuration>
380-
<source>8</source>
303+
<source>11</source>
381304
<doctitle>Jakarta JSON Binding ${project.version} API Specification</doctitle>
382305
<sourceFileExcludes>
383306
<sourceFileExclude>**/module-info.java</sourceFileExclude>
384307
<sourceFileExclude>target/**/*.java</sourceFileExclude>
385308
</sourceFileExcludes>
386309
<docfilessubdirs>true</docfilessubdirs>
387310
<links>
388-
<link>http://docs.oracle.com/javase/8/docs/api/</link>
311+
<link>http://docs.oracle.com/en/java/javase/11/docs/api/</link>
389312
</links>
390313
<detectJavaApiLink>false</detectJavaApiLink>
391314
<detectOfflineLinks>false</detectOfflineLinks>
392315
<header><![CDATA[<br>Jakarta JSON Binding API v${project.version}]]>
393316
</header>
394317
<bottom><![CDATA[
395318
Comments to: <a href="mailto:${release.spec.feedback}">${release.spec.feedback}</a>.<br>
396-
Copyright &#169; 2019 Eclipse Foundation. All Rights Reserved.<br>
319+
Copyright &#169; 2019, 2021 Eclipse Foundation. All Rights Reserved.<br>
397320
Use is subject to <a href="{@docRoot}/doc-files/EFSL.html" target="_top">license terms</a>.]]>
398321
</bottom>
399322
</configuration>
@@ -435,7 +358,7 @@
435358
<plugin>
436359
<groupId>org.glassfish.copyright</groupId>
437360
<artifactId>glassfish-copyright-maven-plugin</artifactId>
438-
<version>2.3</version>
361+
<version>2.4</version>
439362
<configuration>
440363
<excludeFile>${basedir}/../etc/config/copyright-exclude</excludeFile>
441364
<scm>git</scm>
@@ -452,6 +375,7 @@
452375
<executions>
453376
<execution>
454377
<goals>
378+
<goal>copyright</goal>
455379
<goal>check</goal>
456380
</goals>
457381
<phase>compile</phase>
@@ -466,7 +390,7 @@
466390
<dependency>
467391
<groupId>com.puppycrawl.tools</groupId>
468392
<artifactId>checkstyle</artifactId>
469-
<version>8.18</version>
393+
<version>8.29</version>
470394
</dependency>
471395
</dependencies>
472396
<configuration>
@@ -554,12 +478,12 @@
554478
<plugin>
555479
<groupId>biz.aQute.bnd</groupId>
556480
<artifactId>bnd-baseline-maven-plugin</artifactId>
557-
<version>4.3.0</version>
481+
<version>6.0.0</version>
558482
<configuration>
559483
<base>
560484
<version>${baseline.compare.version}</version>
561485
</base>
562-
</configuration>
486+
</configuration>
563487
<executions>
564488
<execution>
565489
<id>baseline</id>

api/src/main/java/jakarta/json/bind/Jsonb.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -260,7 +260,8 @@ public interface Jsonb extends AutoCloseable {
260260
* The root object of the object content tree to be serialized. Must not be null.
261261
*
262262
* @param runtimeType
263-
* Runtime type of the content tree's root object.
263+
* Runtime type of the content tree's root object. Provided type needs to be
264+
* related to the type of the instance.
264265
*
265266
* @return String instance with serialized JSON data.
266267
*
@@ -298,7 +299,8 @@ public interface Jsonb extends AutoCloseable {
298299
* The object content tree to be serialized.
299300
*
300301
* @param runtimeType
301-
* Runtime type of the content tree's root object.
302+
* Runtime type of the content tree's root object. Provided type needs to be
303+
* related to the type of the instance.
302304
*
303305
* @param writer
304306
* The JSON will be sent as a character stream to the given
@@ -339,7 +341,8 @@ public interface Jsonb extends AutoCloseable {
339341
* The object content tree to be serialized.
340342
*
341343
* @param runtimeType
342-
* Runtime type of the content tree's root object.
344+
* Runtime type of the content tree's root object. Provided type needs to be
345+
* related to the type of the instance.
343346
*
344347
* @param stream
345348
* The JSON will be sent as a byte stream to the given

api/src/main/java/jakarta/json/bind/JsonbConfig.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -141,6 +141,11 @@ public class JsonbConfig {
141141
*/
142142
public static final String LOCALE = "jsonb.locale";
143143

144+
/**
145+
* Property used to specify required creator parameters.
146+
*/
147+
public static final String CREATOR_PARAMETERS_REQUIRED = "jsonb.creator-parameters-required";
148+
144149
/**
145150
* Set the particular configuration property to a new value. The method can
146151
* only be used to set one of the standard JSON Binding properties defined in
@@ -404,6 +409,18 @@ public final JsonbConfig withLocale(final Locale locale) {
404409
return setProperty(LOCALE, locale);
405410
}
406411

412+
/**
413+
* Property used to specify whether all creator parameters should be treated as required.
414+
* <br>
415+
* Default value is {@code false}.
416+
*
417+
* @param requiredParameters Whether creator parameters are required
418+
* @return This JsonbConfig instance.
419+
*/
420+
public final JsonbConfig withCreatorParametersRequired(final boolean requiredParameters) {
421+
return setProperty(CREATOR_PARAMETERS_REQUIRED, requiredParameters);
422+
}
423+
407424
@SuppressWarnings("unchecked")
408425
private <T> void mergeProperties(final String propertyKey, final T[] values, final Class<T> tClass) {
409426
final Optional<Object> property = getProperty(propertyKey);

api/src/main/java/jakarta/json/bind/annotation/JsonbCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -31,7 +31,7 @@
3131
* Such parameters could be annotated for instance with {@code @JsonbProperty}.</p>
3232
*
3333
* <p><b>Usage</b></p>
34-
* <p>The {@code @JsonbCreator} annotation can be used with the followingprogram elements:</p>
34+
* <p>The {@code @JsonbCreator} annotation can be used with the following program elements:</p>
3535
* <ul>
3636
* <li> method </li>
3737
* <li> constructor </li>

0 commit comments

Comments
 (0)