Repository: johnzon Updated Branches: refs/heads/master 68dc83757 -> bbc4e89c9
JOHNZON-116 move JSON-B API to Geronimo Project: http://git-wip-us.apache.org/repos/asf/johnzon/repo Commit: http://git-wip-us.apache.org/repos/asf/johnzon/commit/bbc4e89c Tree: http://git-wip-us.apache.org/repos/asf/johnzon/tree/bbc4e89c Diff: http://git-wip-us.apache.org/repos/asf/johnzon/diff/bbc4e89c Branch: refs/heads/master Commit: bbc4e89c9e74313f611fc7379a89dc2a372a6365 Parents: 68dc837 Author: Mark Struberg <[email protected]> Authored: Thu Apr 20 22:27:56 2017 +0200 Committer: Mark Struberg <[email protected]> Committed: Thu Apr 20 22:27:56 2017 +0200 ---------------------------------------------------------------------- johnzon-jsonb/pom.xml | 8 +- jsonb-api/pom.xml | 36 --- jsonb-api/run_sigtest.sh | 39 --- .../src/main/java/javax/json/bind/Jsonb.java | 51 ---- .../main/java/javax/json/bind/JsonbBuilder.java | 50 ---- .../main/java/javax/json/bind/JsonbConfig.java | 134 ---------- .../java/javax/json/bind/JsonbException.java | 31 --- .../javax/json/bind/adapter/JsonbAdapter.java | 24 -- .../json/bind/annotation/JsonbAnnotation.java | 28 -- .../json/bind/annotation/JsonbCreator.java | 30 --- .../json/bind/annotation/JsonbDateFormat.java | 40 --- .../json/bind/annotation/JsonbNillable.java | 31 --- .../json/bind/annotation/JsonbNumberFormat.java | 40 --- .../json/bind/annotation/JsonbProperty.java | 35 --- .../bind/annotation/JsonbPropertyOrder.java | 31 --- .../json/bind/annotation/JsonbTransient.java | 32 --- .../json/bind/annotation/JsonbTypeAdapter.java | 32 --- .../bind/annotation/JsonbTypeDeserializer.java | 36 --- .../bind/annotation/JsonbTypeSerializer.java | 36 --- .../json/bind/annotation/JsonbVisibility.java | 34 --- .../json/bind/config/BinaryDataStrategy.java | 29 --- .../bind/config/PropertyNamingStrategy.java | 30 --- .../json/bind/config/PropertyOrderStrategy.java | 29 --- .../bind/config/PropertyVisibilityStrategy.java | 27 -- .../bind/serializer/DeserializationContext.java | 31 --- .../json/bind/serializer/JsonbDeserializer.java | 30 --- .../json/bind/serializer/JsonbSerializer.java | 25 -- .../bind/serializer/SerializationContext.java | 27 -- .../java/javax/json/bind/spi/JsonbProvider.java | 59 ----- pom.xml | 258 +++++++++---------- src/site/markdown/index.md | 9 +- 31 files changed, 135 insertions(+), 1197 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/johnzon-jsonb/pom.xml ---------------------------------------------------------------------- diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml index 1c225a9..d68cb37 100644 --- a/johnzon-jsonb/pom.xml +++ b/johnzon-jsonb/pom.xml @@ -46,13 +46,13 @@ <version>1.0</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>org.apache.johnzon</groupId> - <artifactId>jsonb-api</artifactId> - <version>1.1.0-SNAPSHOT</version> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jsonb_1.0_spec</artifactId> + <version>1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> + <dependency> <groupId>org.apache.johnzon</groupId> <artifactId>johnzon-mapper</artifactId> http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/pom.xml ---------------------------------------------------------------------- diff --git a/jsonb-api/pom.xml b/jsonb-api/pom.xml deleted file mode 100644 index 6dcf095..0000000 --- a/jsonb-api/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>johnzon</artifactId> - <groupId>org.apache.johnzon</groupId> - <version>1.1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>jsonb-api</artifactId> - <version>1.1.0-SNAPSHOT</version> - <name>Johnzon :: JSON-B API</name> - - <properties> - <java-compile.version>1.8</java-compile.version> - <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory> - </properties> -</project> http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/run_sigtest.sh ---------------------------------------------------------------------- diff --git a/jsonb-api/run_sigtest.sh b/jsonb-api/run_sigtest.sh deleted file mode 100755 index df79942..0000000 --- a/jsonb-api/run_sigtest.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# file to run the JPA signature tests - - -# HOWTO: -# -# Download sigtestdev.jar from https://wiki.openjdk.java.net/display/CodeTools/SigTest -# Copy to a local folder and set SIGTEST_HOME to it. - - -# needed, because we have deps to other specs in JSONB -mvn dependency:copy-dependencies - -# generate the SIG for the RI -# there is currently no official jar yet. If availablen, then: curl http://repo1.maven.org/maven2/javax/json/... > ./target/javax.json-1.1.jar -java -jar ${SIGTEST_HOME}/lib/sigtestdev.jar Setup -classpath ${JAVA_HOME}/jre/lib/rt.jar:./javax.json.bind-api.jar:./target/dependency/geronimo-json_1.1_spec-1.0-SNAPSHOT.jar -Package javax.json -FileName target/javax.json.bind-api.sig -static - -# this generates the signature for our own jpa api -java -jar ${SIGTEST_HOME}/lib/sigtestdev.jar Setup -classpath ${JAVA_HOME}/jre/lib/rt.jar:./target/dependency/geronimo-json_1.1_spec-1.0-SNAPSHOT.jar:./target/jsonb-api-1.1.0-SNAPSHOT.jar -Package javax.json -FileName target/jsonb-api-1.1.0-SNAPSHOT.sig -static - -# then open the 2 generated sig files in a diff browser and the only difference should be some internal variables. http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/Jsonb.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/Jsonb.java b/jsonb-api/src/main/java/javax/json/bind/Jsonb.java deleted file mode 100644 index 83de741..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/Jsonb.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.io.Writer; -import java.lang.reflect.Type; - -public interface Jsonb extends AutoCloseable { - <T> T fromJson(String str, Class<T> type) throws JsonbException; - - <T> T fromJson(String str, Type runtimeType) throws JsonbException; - - <T> T fromJson(Reader reader, Class<T> type) throws JsonbException; - - <T> T fromJson(Reader reader, Type runtimeType) throws JsonbException; - - <T> T fromJson(InputStream stream, Class<T> type) throws JsonbException; - - <T> T fromJson(InputStream stream, Type runtimeType) throws JsonbException; - - String toJson(Object object) throws JsonbException; - - String toJson(Object object, Type runtimeType) throws JsonbException; - - void toJson(Object object, Writer writer) throws JsonbException; - - void toJson(Object object, Type runtimeType, Writer writer) throws JsonbException; - - void toJson(Object object, OutputStream stream) throws JsonbException; - - void toJson(Object object, Type runtimeType, OutputStream stream) throws JsonbException; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/JsonbBuilder.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/JsonbBuilder.java b/jsonb-api/src/main/java/javax/json/bind/JsonbBuilder.java deleted file mode 100644 index 77e4a8c..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/JsonbBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind; - -import javax.json.bind.spi.JsonbProvider; -import javax.json.spi.JsonProvider; - -public interface JsonbBuilder { - JsonbBuilder withConfig(final JsonbConfig config); - - JsonbBuilder withProvider(final JsonProvider jsonpProvider); - - Jsonb build(); - - static Jsonb create() { - return JsonbProvider.provider().create().build(); - } - - static Jsonb create(final JsonbConfig config) { - return JsonbProvider.provider().create().withConfig(config).build(); - } - - static JsonbBuilder newBuilder() { - return JsonbProvider.provider().create(); - } - - static JsonbBuilder newBuilder(final String providerName) { - return JsonbProvider.provider(providerName).create(); - } - - static JsonbBuilder newBuilder(final JsonbProvider provider) { - return provider.create(); - } -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/JsonbConfig.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/JsonbConfig.java b/jsonb-api/src/main/java/javax/json/bind/JsonbConfig.java deleted file mode 100644 index 2545961..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/JsonbConfig.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind; - -import javax.json.bind.adapter.JsonbAdapter; -import javax.json.bind.config.PropertyNamingStrategy; -import javax.json.bind.config.PropertyVisibilityStrategy; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import java.lang.reflect.Array; -import java.util.Collections; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; - -public class JsonbConfig { - private final Map<String, Object> configuration = new HashMap<>(); - - public static final String FORMATTING = "jsonb.formatting"; - public static final String ENCODING = "jsonb.encoding"; - public static final String PROPERTY_NAMING_STRATEGY = "jsonb.property-naming-strategy"; - public static final String PROPERTY_ORDER_STRATEGY = "jsonb.property-order-strategy"; - public static final String NULL_VALUES = "jsonb.null-values"; - public static final String STRICT_IJSON = "jsonb.strict-ijson"; - public static final String PROPERTY_VISIBILITY_STRATEGY = "jsonb.property-visibility-strategy"; - public static final String ADAPTERS = "jsonb.adapters"; - public static final String BINARY_DATA_STRATEGY = "jsonb.binary-data-strategy"; - public static final String DATE_FORMAT = "jsonb.date-format"; - public static final String LOCALE = "jsonb.locale"; - public static final String SERIALIZERS = "jsonb.serializers"; - public static final String DESERIALIZERS = "jsonb.derializers"; - - public final JsonbConfig withDateFormat(final String dateFormat, final Locale locale) { - return setProperty(DATE_FORMAT, dateFormat).setProperty(LOCALE, locale != null ? locale : Locale.getDefault()); - } - - public final JsonbConfig withLocale(final Locale locale) { - return setProperty(LOCALE, locale); - } - - public final JsonbConfig setProperty(final String name, final Object value) { - configuration.put(name, value); - return this; - } - - public final Optional<Object> getProperty(final String name) { - return Optional.ofNullable(configuration.get(name)); - } - - public final Map<String, Object> getAsMap() { - return Collections.unmodifiableMap(configuration); - } - - public final JsonbConfig withFormatting(final Boolean formatted) { - return setProperty(FORMATTING, formatted); - } - - public final JsonbConfig withNullValues(final Boolean serializeNullValues) { - return setProperty(NULL_VALUES, serializeNullValues); - } - - public final JsonbConfig withEncoding(final String encoding) { - return setProperty(ENCODING, encoding); - } - - public final JsonbConfig withStrictIJSON(final Boolean enabled) { - return setProperty(STRICT_IJSON, enabled); - } - - public final JsonbConfig withPropertyNamingStrategy(final PropertyNamingStrategy propertyNamingStrategy) { - return setProperty(PROPERTY_NAMING_STRATEGY, propertyNamingStrategy); - } - - public final JsonbConfig withPropertyNamingStrategy(final String propertyNamingStrategy) { - return setProperty(PROPERTY_NAMING_STRATEGY, propertyNamingStrategy); - } - - public final JsonbConfig withPropertyOrderStrategy(final String propertyOrderStrategy) { - return setProperty(PROPERTY_ORDER_STRATEGY, propertyOrderStrategy); - } - - public final JsonbConfig withPropertyVisibilityStrategy(final PropertyVisibilityStrategy propertyVisibilityStrategy) { - return setProperty(PROPERTY_VISIBILITY_STRATEGY, propertyVisibilityStrategy); - } - - public final JsonbConfig withAdapters(final JsonbAdapter... adapters) { - return accumulate(ADAPTERS, adapters, JsonbAdapter.class); - } - - public final JsonbConfig withBinaryDataStrategy(final String binaryDataStrategy) { - return setProperty(BINARY_DATA_STRATEGY, binaryDataStrategy); - } - - public final JsonbConfig withSerializers(final JsonbSerializer... serializers) { - return accumulate(SERIALIZERS, serializers, JsonbSerializer.class); - } - - public final JsonbConfig withDeserializers(final JsonbDeserializer... deserializers) { - return accumulate(DESERIALIZERS, deserializers, JsonbDeserializer.class); - } - - private <T> JsonbConfig accumulate(final String key, final T[] values, final Class<T> componentType) { - if (values == null || values.length == 0) { - return this; - } - - final Optional<Object> opt = getProperty(key); - if (opt.isPresent()) { - final T[] existing = (T[]) opt.get(); - final T[] aggregated = (T[]) Array.newInstance(componentType, existing.length + values.length); - System.arraycopy(existing, 0, aggregated, 0, existing.length); - System.arraycopy(values, 0, aggregated, existing.length + 1, values.length); - return setProperty(key, aggregated); - } - return setProperty(key, values); - } -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/JsonbException.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/JsonbException.java b/jsonb-api/src/main/java/javax/json/bind/JsonbException.java deleted file mode 100644 index 6cf0cdd..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/JsonbException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind; - -public class JsonbException extends RuntimeException { - private static final long serialVersionUID = 1L; - - public JsonbException(final String message) { - super(message); - } - - public JsonbException(final String message, final Throwable cause) { - super(message, cause); - } -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/adapter/JsonbAdapter.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/adapter/JsonbAdapter.java b/jsonb-api/src/main/java/javax/json/bind/adapter/JsonbAdapter.java deleted file mode 100644 index 87bc0b7..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/adapter/JsonbAdapter.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.adapter; - -public interface JsonbAdapter<OriginalType, JsonType> { - JsonType adaptToJson(OriginalType obj) throws Exception; - OriginalType adaptFromJson(JsonType obj) throws Exception; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbAnnotation.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbAnnotation.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbAnnotation.java deleted file mode 100644 index e7a09bf..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbAnnotation.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Documented -@Retention(RetentionPolicy.RUNTIME) -public @interface JsonbAnnotation { -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbCreator.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbCreator.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbCreator.java deleted file mode 100644 index 9502320..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbCreator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR}) -public @interface JsonbCreator { -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbDateFormat.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbDateFormat.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbDateFormat.java deleted file mode 100644 index 3f7c2ec..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbDateFormat.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ - ElementType.ANNOTATION_TYPE, ElementType.FIELD, - ElementType.METHOD, ElementType.TYPE, - ElementType.PARAMETER, ElementType.PACKAGE -}) -public @interface JsonbDateFormat { - String DEFAULT_LOCALE = "##default"; - String DEFAULT_FORMAT = "##default"; - String TIME_IN_MILLIS = "##time-in-millis"; - - String value() default DEFAULT_FORMAT; - String locale() default DEFAULT_LOCALE; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNillable.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNillable.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNillable.java deleted file mode 100644 index a2a70c6..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNillable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.PACKAGE}) -public @interface JsonbNillable { - boolean value() default true; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNumberFormat.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNumberFormat.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNumberFormat.java deleted file mode 100644 index 06bfa9a..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbNumberFormat.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ - ElementType.ANNOTATION_TYPE, ElementType.FIELD, - ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER, - ElementType.PACKAGE -}) -public @interface JsonbNumberFormat { - String DEFAULT_LOCALE = "##default"; - - String value() default ""; - - String locale() default DEFAULT_LOCALE; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbProperty.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbProperty.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbProperty.java deleted file mode 100644 index b8234ba..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbProperty.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ - ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER -}) -public @interface JsonbProperty { - String value() default ""; - - boolean nillable() default false; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbPropertyOrder.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbPropertyOrder.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbPropertyOrder.java deleted file mode 100644 index b06a868..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbPropertyOrder.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE}) -public @interface JsonbPropertyOrder { - String[] value(); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTransient.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTransient.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTransient.java deleted file mode 100644 index 57fc5b8..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTransient.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD}) -public @interface JsonbTransient { -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeAdapter.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeAdapter.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeAdapter.java deleted file mode 100644 index 8ceef17..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeAdapter.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import javax.json.bind.adapter.JsonbAdapter; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) -public @interface JsonbTypeAdapter { - Class<? extends JsonbAdapter> value(); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeDeserializer.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeDeserializer.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeDeserializer.java deleted file mode 100644 index 0427a3a..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeDeserializer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import javax.json.bind.serializer.JsonbDeserializer; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ANNOTATION_TYPE, TYPE, FIELD, METHOD}) -public @interface JsonbTypeDeserializer { - Class<? extends JsonbDeserializer> value(); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeSerializer.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeSerializer.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeSerializer.java deleted file mode 100644 index a0c7980..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbTypeSerializer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import javax.json.bind.serializer.JsonbSerializer; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ANNOTATION_TYPE, TYPE, FIELD, METHOD}) -public @interface JsonbTypeSerializer { - Class<? extends JsonbSerializer> value(); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbVisibility.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbVisibility.java b/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbVisibility.java deleted file mode 100644 index 69265f8..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/annotation/JsonbVisibility.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.annotation; - -import javax.json.bind.config.PropertyVisibilityStrategy; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@JsonbAnnotation -@Retention(RetentionPolicy.RUNTIME) -@Target({ - ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.PACKAGE -}) -public @interface JsonbVisibility { - Class<? extends PropertyVisibilityStrategy> value(); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/config/BinaryDataStrategy.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/config/BinaryDataStrategy.java b/jsonb-api/src/main/java/javax/json/bind/config/BinaryDataStrategy.java deleted file mode 100644 index 1871826..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/config/BinaryDataStrategy.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.config; - -public final class BinaryDataStrategy { - private BinaryDataStrategy() { - // no-op - } - - public static final String BYTE = "BYTE"; - public static final String BASE_64 = "BASE_64"; - public static final String BASE_64_URL = "BASE_64_URL"; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/config/PropertyNamingStrategy.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/config/PropertyNamingStrategy.java b/jsonb-api/src/main/java/javax/json/bind/config/PropertyNamingStrategy.java deleted file mode 100644 index 218e087..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/config/PropertyNamingStrategy.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.config; - -public interface PropertyNamingStrategy { - String IDENTITY = "IDENTITY"; - String LOWER_CASE_WITH_DASHES = "LOWER_CASE_WITH_DASHES"; - String LOWER_CASE_WITH_UNDERSCORES = "LOWER_CASE_WITH_UNDERSCORES"; - String UPPER_CAMEL_CASE = "UPPER_CAMEL_CASE"; - String UPPER_CAMEL_CASE_WITH_SPACES = "UPPER_CAMEL_CASE_WITH_SPACES"; - String CASE_INSENSITIVE = "CASE_INSENSITIVE"; - - String translateName(String propertyName); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/config/PropertyOrderStrategy.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/config/PropertyOrderStrategy.java b/jsonb-api/src/main/java/javax/json/bind/config/PropertyOrderStrategy.java deleted file mode 100644 index 5db8c0e..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/config/PropertyOrderStrategy.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.config; - -public final class PropertyOrderStrategy { - private PropertyOrderStrategy() { - // no-op - } - - public static final String LEXICOGRAPHICAL = "LEXICOGRAPHICAL"; - public static final String ANY = "ANY"; - public static final String REVERSE = "REVERSE"; -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/config/PropertyVisibilityStrategy.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/config/PropertyVisibilityStrategy.java b/jsonb-api/src/main/java/javax/json/bind/config/PropertyVisibilityStrategy.java deleted file mode 100644 index 14f915e..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/config/PropertyVisibilityStrategy.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.config; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -public interface PropertyVisibilityStrategy { - boolean isVisible(Field field); - boolean isVisible(Method method); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/serializer/DeserializationContext.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/serializer/DeserializationContext.java b/jsonb-api/src/main/java/javax/json/bind/serializer/DeserializationContext.java deleted file mode 100644 index 5b6ebae..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/serializer/DeserializationContext.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.serializer; - -import javax.json.stream.JsonParser; -import java.lang.reflect.Type; - -public interface DeserializationContext { - /** - * JsonParser cursor is at KEY_NAME event. - */ - <T> T deserialize(Class<T> clazz, JsonParser parser); - - <T> T deserialize(Type type, JsonParser parser); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbDeserializer.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbDeserializer.java b/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbDeserializer.java deleted file mode 100644 index 1f4de04..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbDeserializer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.serializer; - -import javax.json.stream.JsonParser; -import java.lang.reflect.Type; - -public interface JsonbDeserializer<T> { - /** - * JsonParser is at START_OBJECT event. - */ - T deserialize(JsonParser parser, DeserializationContext ctx, Type rtType); -} - http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbSerializer.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbSerializer.java b/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbSerializer.java deleted file mode 100644 index 6b487a8..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/serializer/JsonbSerializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.serializer; - -import javax.json.stream.JsonGenerator; - -public interface JsonbSerializer<T> { - void serialize(T obj, JsonGenerator generator, SerializationContext ctx); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/serializer/SerializationContext.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/serializer/SerializationContext.java b/jsonb-api/src/main/java/javax/json/bind/serializer/SerializationContext.java deleted file mode 100644 index aac3b6b..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/serializer/SerializationContext.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.serializer; - -import javax.json.stream.JsonGenerator; - -public interface SerializationContext { - <T> void serialize(String key, T object, JsonGenerator generator); - - <T> void serialize(T object, JsonGenerator generator); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/jsonb-api/src/main/java/javax/json/bind/spi/JsonbProvider.java ---------------------------------------------------------------------- diff --git a/jsonb-api/src/main/java/javax/json/bind/spi/JsonbProvider.java b/jsonb-api/src/main/java/javax/json/bind/spi/JsonbProvider.java deleted file mode 100644 index 8c75a4b..0000000 --- a/jsonb-api/src/main/java/javax/json/bind/spi/JsonbProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package javax.json.bind.spi; - -import javax.json.bind.JsonbBuilder; -import javax.json.bind.JsonbException; -import java.util.Iterator; -import java.util.ServiceLoader; - -public abstract class JsonbProvider { - private static final String DEFAULT_PROVIDER = "org.apache.johnzon.jsonb.JohnzonProvider"; - - public static JsonbProvider provider() { - final Iterator<JsonbProvider> it = ServiceLoader.load(JsonbProvider.class).iterator(); - if (it.hasNext()) { - return it.next(); - } - - try { - return JsonbProvider.class.cast(Thread.currentThread().getContextClassLoader().loadClass(DEFAULT_PROVIDER).newInstance()); - } catch (final ClassNotFoundException cnfe) { - throw new JsonbException(DEFAULT_PROVIDER + " not found", cnfe); - } catch (final Exception x) { - throw new JsonbException(DEFAULT_PROVIDER + " couldn't be instantiated: " + x, x); - } - } - - public static JsonbProvider provider(final String providerFqn) { - if (providerFqn == null) { - throw new IllegalArgumentException(); - } - for (final JsonbProvider provider : ServiceLoader.load(JsonbProvider.class)) { - if (providerFqn.equals(provider.getClass().getName())) { - return provider; - } - } - - final String msg = providerFqn + " not found"; - throw new JsonbException(msg, new ClassNotFoundException(msg)); - } - - public abstract JsonbBuilder create(); -} http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index b9fa74a..85492c2 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,8 @@ <module>johnzon-jaxrs</module> <module>johnzon-distribution</module> <module>johnzon-maven-plugin</module> + <module>johnzon-websocket</module> + <module>johnzon-jsonb</module> </modules> <dependencies> @@ -92,6 +94,7 @@ <showWarnings>true</showWarnings> </configuration> </plugin> + <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> @@ -123,6 +126,7 @@ </execution> </executions> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-scm-publish-plugin</artifactId> @@ -167,6 +171,7 @@ </dependency> </dependencies> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> @@ -181,13 +186,13 @@ </execution> </executions> <configuration> - <encoding>UTF-8</encoding> - <consoleOutput>true</consoleOutput> - <failOnViolation>true</failOnViolation> - <includeTestSourceDirectory>true</includeTestSourceDirectory> - <failsOnError>true</failsOnError> - <linkXRef>true</linkXRef> - <logViolationsToConsole>true</logViolationsToConsole> + <encoding>UTF-8</encoding> + <consoleOutput>true</consoleOutput> + <failOnViolation>true</failOnViolation> + <includeTestSourceDirectory>true</includeTestSourceDirectory> + <failsOnError>true</failsOnError> + <linkXRef>true</linkXRef> + <logViolationsToConsole>true</logViolationsToConsole> <checkstyleRules> <module name="Checker"> <module name="SuppressionCommentFilter" /> @@ -260,6 +265,7 @@ </checkstyleRules> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> @@ -273,6 +279,7 @@ </execution> </executions> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> @@ -281,6 +288,7 @@ <skipIfEmpty>true</skipIfEmpty> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> @@ -298,6 +306,7 @@ </execution> </executions> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -306,58 +315,63 @@ <argLine>${surefire.jvm.params}</argLine> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <configuration> - <tagNameFormat>v@{project.version}</tagNameFormat> - <pushChanges>false</pushChanges> - <localCheckout>true</localCheckout> - <autoVersionSubmodules>true</autoVersionSubmodules> - </configuration> - </plugin> - <plugin> + <tagNameFormat>v@{project.version}</tagNameFormat> + <pushChanges>false</pushChanges> + <localCheckout>true</localCheckout> + <autoVersionSubmodules>true</autoVersionSubmodules> + </configuration> + </plugin> + + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.6</version> - <configuration> - <instrumentation> - <ignores> - <ignore>org.apache.johnzon.maven.*</ignore> - </ignores> - <excludes> - <exclude>org/apache/johnzon/**/*Mojo*.class</exclude> - <exclude>org/apache/johnzon/**/*Test.class</exclude> - </excludes> - </instrumentation> - <formats> - <format>xml</format> - </formats> - <aggregate>true</aggregate> - </configuration> - </plugin> - <plugin> - <groupId>org.eluder.coveralls</groupId> - <artifactId>coveralls-maven-plugin</artifactId> - <version>3.0.1</version> - <configuration> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <version>${felix.plugin.version}</version> - <inherited>true</inherited> - <extensions>true</extensions> - <configuration> - <instructions> - <_removeheaders>Private-Package,Include-Resource,Embed-Dependency,Created-By,Bnd-LastModified,Built-By,Tool</_removeheaders> - <_versionpolicy>${bnd.version.policy}</_versionpolicy> - <Bundle-DocURL>http://johnzon.apache.org/</Bundle-DocURL> - </instructions> - </configuration> - </plugin> - <plugin> + <configuration> + <instrumentation> + <ignores> + <ignore>org.apache.johnzon.maven.*</ignore> + </ignores> + <excludes> + <exclude>org/apache/johnzon/**/*Mojo*.class</exclude> + <exclude>org/apache/johnzon/**/*Test.class</exclude> + </excludes> + </instrumentation> + <formats> + <format>xml</format> + </formats> + <aggregate>true</aggregate> + </configuration> + </plugin> + + <plugin> + <groupId>org.eluder.coveralls</groupId> + <artifactId>coveralls-maven-plugin</artifactId> + <version>3.0.1</version> + <configuration> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>${felix.plugin.version}</version> + <inherited>true</inherited> + <extensions>true</extensions> + <configuration> + <instructions> + <_removeheaders>Private-Package,Include-Resource,Embed-Dependency,Created-By,Bnd-LastModified,Built-By,Tool</_removeheaders> + <_versionpolicy>${bnd.version.policy}</_versionpolicy> + <Bundle-DocURL>http://johnzon.apache.org/</Bundle-DocURL> + </instructions> + </configuration> + </plugin> + + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4</version> @@ -429,7 +443,7 @@ <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.9</version> <configuration> - <dependencyLocationsEnabled>false</dependencyLocationsEnabled> + <dependencyLocationsEnabled>false</dependencyLocationsEnabled> </configuration> </plugin> <plugin> @@ -460,57 +474,57 @@ <artifactId>maven-surefire-report-plugin</artifactId> <version>2.19.1</version> <configuration> - <argLine>${surefire.jvm.params}</argLine> - <aggregate>true</aggregate> + <argLine>${surefire.jvm.params}</argLine> + <aggregate>true</aggregate> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.6</version> - <configuration> - <instrumentation> - <ignores> - <ignore>org.apache.johnzon.maven.*</ignore> - </ignores> - <excludes> - <exclude>org/apache/johnzon/**/*Mojo*.class</exclude> - <exclude>org/apache/johnzon/**/*Test.class</exclude> - </excludes> - </instrumentation> - <formats> - <format>html</format> - </formats> - <aggregate>true</aggregate> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>${checkstyle.version}</version> - <reportSets> - <reportSet> - <reports> - <report>checkstyle</report> - </reports> - </reportSet> - </reportSets> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>versions-maven-plugin</artifactId> - <version>2.1</version> - <reportSets> - <reportSet> - <reports> - <report>dependency-updates-report</report> - <report>plugin-updates-report</report> - <report>property-updates-report</report> - </reports> - </reportSet> - </reportSets> - </plugin> - <plugin> + <configuration> + <instrumentation> + <ignores> + <ignore>org.apache.johnzon.maven.*</ignore> + </ignores> + <excludes> + <exclude>org/apache/johnzon/**/*Mojo*.class</exclude> + <exclude>org/apache/johnzon/**/*Test.class</exclude> + </excludes> + </instrumentation> + <formats> + <format>html</format> + </formats> + <aggregate>true</aggregate> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${checkstyle.version}</version> + <reportSets> + <reportSet> + <reports> + <report>checkstyle</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>versions-maven-plugin</artifactId> + <version>2.1</version> + <reportSets> + <reportSet> + <reports> + <report>dependency-updates-report</report> + <report>plugin-updates-report</report> + <report>property-updates-report</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> <version>2.4</version> @@ -677,42 +691,24 @@ <contributors> <contributor> - <name>Thiago Veronezi</name> + <name>Thiago Veronezi</name> </contributor> - <contributor> - <name>Karl Grosse</name> + <contributor> + <name>Karl Grosse</name> </contributor> </contributors> - <profiles> - <profile> - <!-- Websocket module needs java 1.7 or higher --> - <id>jdk1.7+</id> - <activation> - <jdk>[1.7,)</jdk> - </activation> - <modules> - <module>johnzon-websocket</module> - </modules> - <properties> - <checkstyle.version>2.17</checkstyle.version> - </properties> - </profile> - <profile> - <!-- jsonb module needs java 1.8 or higher --> - <id>jdk1.8+</id> - <activation> - <jdk>[1.8,)</jdk> - </activation> - <modules> - <module>jsonb-api</module> - <module>johnzon-jsonb</module> - </modules> - <properties> - <checkstyle.version>2.17</checkstyle.version> - <javadoc.params>-Xdoclint:none</javadoc.params> - </properties> - </profile> - </profiles> + <profiles> + <profile> + <id>doclint-java8-disable</id> + <activation> + <jdk>[1.8,)</jdk> + </activation> + <properties> + <checkstyle.version>2.17</checkstyle.version> + <javadoc.params>-Xdoclint:none</javadoc.params> + </properties> + </profile> + </profiles> </project> http://git-wip-us.apache.org/repos/asf/johnzon/blob/bbc4e89c/src/site/markdown/index.md ---------------------------------------------------------------------- diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index ab9e0db..30ee3de 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -24,10 +24,9 @@ for this specification like an Object mapper, some JAX-RS providers and a WebSoc ## Status Apache Johnzon is a Top Level Project at the Apache Software Foundation (ASF). -It fully implements the JSON-P_1.0 specification (JSR-353). -Johnzon also targets the upcoming JSON-P_1.1 and JSON-B_1.0 specifications. +It fully implements the SON-P_1.1 (JSR-353) and JSON-B_1.0 (JSR-367) specifications. -The current version is Apache Johnzon 1.0.0. +The current version is Apache Johnzon 1.1.0. ## Get started @@ -292,9 +291,9 @@ TomEE uses by default Johnzon as JAX-RS provider for versions 7.x. If you want h Note: as you can see you mainly just need to define a service with the id johnzon (same as in openejb-jar.xml) and you can reference other instances using $id for services and @id for resources. -### JSON-B (not yet fully compliant) +### JSON-B (JSON-B 1.0 compliant) -Johnzon provides a module johnzon-jsonb and jsonb-api implementing JSON-B standard based on Johnzon Mapper. +Johnzon provides a module johnzon-jsonb implementing JSON-B standard based on Johnzon Mapper. It fully reuses the JSON-B as API.
