Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jakarta Namespace - jackson compatible on the jakarta classifier
just until FasterXML/jackson-modules-base#116
- Loading branch information
Showing
82 changed files
with
6,116 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
apache-cxf/src/jre8/resources/META-INF/services/jakarta.ws.rs.ext.RuntimeDelegate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl |
1 change: 1 addition & 0 deletions
1
apache-cxf/src/jre8/resources/META-INF/services/jakarta.ws.rs.sse.SseEventSource$Builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.apache.cxf.jaxrs.sse.client.SseEventSourceBuilderImpl |
2 changes: 2 additions & 0 deletions
2
apache-cxf/src/jre8/resources/META-INF/services/jakarta.xml.soap.MessageFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl | ||
com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl |
1 change: 1 addition & 0 deletions
1
apache-cxf/src/jre8/resources/META-INF/services/jakarta.xml.soap.SAAJMetaFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl |
1 change: 1 addition & 0 deletions
1
apache-cxf/src/jre8/resources/META-INF/services/jakarta.xml.soap.SOAPConnectionFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory |
2 changes: 2 additions & 0 deletions
2
apache-cxf/src/jre8/resources/META-INF/services/jakarta.xml.soap.SOAPFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl | ||
com.sun.xml.messaging.saaj.soap.ver1_2.SOAPFactory1_2Impl |
1 change: 1 addition & 0 deletions
1
apache-cxf/src/jre8/resources/META-INF/services/jakarta.xml.ws.spi.Provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.apache.cxf.jaxws22.spi.ProviderImpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<!-- This module was also published with a richer model, Gradle metadata, --> | ||
<!-- which should be used instead. Do not delete the following line which --> | ||
<!-- is to indicate to Gradle or any Gradle module metadata file consumer --> | ||
<!-- that they should prefer consuming it instead. --> | ||
<!-- do_not_remove: published-with-gradle-metadata --> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.guicedee.services</groupId> | ||
<artifactId>services-parent</artifactId> | ||
<version>0.0.0_0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jackson-jaxrs-base</artifactId> | ||
<name>Jackson-JAXRS-base</name> | ||
<packaging>jar</packaging> | ||
|
||
<description>Pile of code that is shared by all Jackson-based JAX-RS | ||
providers. | ||
</description> | ||
|
||
<properties> | ||
<osgi.export> | ||
${project.groupId}.annotation.*;version=${project.version} | ||
,${project.groupId}.base.*;version=${project.version} | ||
,${project.groupId}.cfg.*;version=${project.version} | ||
,${project.groupId}.util.*;version=${project.version} | ||
</osgi.export> | ||
<osgi.import>javax.ws.rs;version="${javax.ws.rs.version}" | ||
,javax.ws.rs.core;version="${javax.ws.rs.version}" | ||
,javax.ws.rs.ext;version="${javax.ws.rs.version}", | ||
* | ||
</osgi.import> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Extends Jackson core, mapper --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.guicedee.services</groupId> | ||
<artifactId>jakarta.ws.rs-api</artifactId> | ||
</dependency> | ||
<!-- test deps should come from parent --> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.moditect</groupId> | ||
<artifactId>moditect-maven-plugin</artifactId> | ||
<configuration> | ||
<jvmVersion>11</jvmVersion> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>jakarta</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<shadedArtifactAttached>true</shadedArtifactAttached> | ||
<shadedClassifierName>jakarta</shadedClassifierName> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
<artifactSet> | ||
<includes> | ||
<include>${project.groupId}:${project.artifactId}</include> | ||
</includes> | ||
</artifactSet> | ||
<relocations> | ||
<relocation> | ||
<pattern>javax.xml.bind</pattern> | ||
<shadedPattern>jakarta.xml.bind</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>javax.ws.rs</pattern> | ||
<shadedPattern>jakarta.ws.rs</shadedPattern> | ||
</relocation> | ||
</relocations> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
|
||
</project> |
39 changes: 39 additions & 0 deletions
39
jackson-base/src/main/java/com/fasterxml/jackson/jaxrs/annotation/JacksonFeatures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.fasterxml.jackson.jaxrs.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import com.fasterxml.jackson.databind.DeserializationFeature; | ||
import com.fasterxml.jackson.databind.SerializationFeature; | ||
|
||
/** | ||
* Annotation that can be used enable and/or disable various | ||
* features for <code>ObjectReader</code>s and <code>ObjectWriter</code>s. | ||
*/ | ||
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.PARAMETER }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@com.fasterxml.jackson.annotation.JacksonAnnotation | ||
public @interface JacksonFeatures | ||
{ | ||
/** | ||
* Deserialization features to enable. | ||
*/ | ||
public DeserializationFeature[] deserializationEnable() default { }; | ||
|
||
/** | ||
* Deserialization features to disable. | ||
*/ | ||
public DeserializationFeature[] deserializationDisable() default { }; | ||
|
||
/** | ||
* Serialization features to enable. | ||
*/ | ||
public SerializationFeature[] serializationEnable() default { }; | ||
|
||
/** | ||
* Serialization features to disable. | ||
*/ | ||
public SerializationFeature[] serializationDisable() default { }; | ||
} |
12 changes: 12 additions & 0 deletions
12
jackson-base/src/main/java/com/fasterxml/jackson/jaxrs/annotation/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Package that contains annotations applicable to all content types. | ||
* Currently defined are: | ||
*<ul> | ||
* <li>{@link com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures} allows | ||
* enabling and/or disabling {@link com.fasterxml.jackson.databind.DeserializationFeature}s | ||
* and {@link com.fasterxml.jackson.databind.SerializationFeature}s for individual | ||
* endpoints. | ||
* </li> | ||
* </ul> | ||
*/ | ||
package com.fasterxml.jackson.jaxrs.annotation; |
22 changes: 22 additions & 0 deletions
22
jackson-base/src/main/java/com/fasterxml/jackson/jaxrs/base/JsonMappingExceptionMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.fasterxml.jackson.jaxrs.base; | ||
|
||
import com.fasterxml.jackson.databind.JsonMappingException; | ||
|
||
import jakarta.ws.rs.core.Response; | ||
import jakarta.ws.rs.ext.ExceptionMapper; | ||
|
||
/** | ||
* Implementation if {@link ExceptionMapper} to send down a "400 Bad Request" | ||
* response in the event that unmappable JSON is received. | ||
*<p> | ||
* Note that {@link jakarta.ws.rs.ext.Provider} annotation was include up to | ||
* Jackson 2.7, but removed from 2.8 (as per [jaxrs-providers#22] | ||
* | ||
* @since 2.2 | ||
*/ | ||
public class JsonMappingExceptionMapper implements ExceptionMapper<JsonMappingException> { | ||
@Override | ||
public Response toResponse(JsonMappingException exception) { | ||
return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).type("text/plain").build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
jackson-base/src/main/java/com/fasterxml/jackson/jaxrs/base/JsonParseExceptionMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.fasterxml.jackson.jaxrs.base; | ||
|
||
import com.fasterxml.jackson.core.JsonParseException; | ||
|
||
import jakarta.ws.rs.core.Response; | ||
import jakarta.ws.rs.ext.ExceptionMapper; | ||
|
||
/** | ||
* Implementation of {@link ExceptionMapper} to send down a "400 Bad Request" | ||
* in the event unparsable JSON is received. | ||
*<p> | ||
* Note that {@link jakarta.ws.rs.ext.Provider} annotation was include up to | ||
* Jackson 2.7, but removed from 2.8 (as per [jaxrs-providers#22] | ||
* | ||
* @since 2.2 | ||
*/ | ||
public class JsonParseExceptionMapper implements ExceptionMapper<JsonParseException> { | ||
@Override | ||
public Response toResponse(JsonParseException exception) { | ||
return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).type("text/plain").build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
jackson-base/src/main/java/com/fasterxml/jackson/jaxrs/base/NoContentExceptionSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.fasterxml.jackson.jaxrs.base; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Implementors of this class contains strategies for NoContentException creation | ||
*/ | ||
public interface NoContentExceptionSupplier | ||
{ | ||
String NO_CONTENT_MESSAGE = "No content (empty input stream)"; | ||
|
||
IOException createNoContentException(); | ||
} |
Oops, something went wrong.