[jackson-jaxrs-providers] 97/162: Initial step for #32. Although just now realized it's wrong... will need to rework
Timo Aaltonen
tjaalton at moszumanska.debian.org
Mon Sep 8 22:16:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
tjaalton pushed a commit to branch master
in repository jackson-jaxrs-providers.
commit bafb6fb64bc15482c7bfc56784169204d6c4b1f2
Author: Tatu Saloranta <tatu.saloranta at iki.fi>
Date: Wed Oct 9 23:15:46 2013 -0700
Initial step for #32. Although just now realized it's wrong... will need to rework
---
.../fasterxml/jackson/jaxrs/base/ProviderBase.java | 60 ++++++++++++++++++---
.../jackson/jaxrs/cfg/EndpointConfigBase.java | 61 ++++++----------------
.../fasterxml/jackson/jaxrs/cfg/JaxRSFeature.java | 2 +-
.../jackson/jaxrs/cfg/ObjectReaderInjector.java | 44 ++++++++++++++++
.../jackson/jaxrs/cfg/ObjectWriterInjector.java | 44 ++++++++++++++++
.../jackson/jaxrs/util/EndpointAsBeanProperty.java | 7 +--
.../jackson/jaxrs/json/JacksonJsonProvider.java | 12 ++---
.../jackson/jaxrs/json/JsonEndpointConfig.java | 12 ++---
.../jaxrs/json/annotation/JacksonFeatures.java | 2 +-
.../jackson/jaxrs/smile/JacksonSmileProvider.java | 12 ++---
.../jackson/jaxrs/smile/SmileEndpointConfig.java | 16 +++---
.../jaxrs/smile/annotation/JacksonFeatures.java | 2 +-
.../jackson/jaxrs/xml/JacksonXMLProvider.java | 12 ++---
.../jackson/jaxrs/xml/XMLEndpointConfig.java | 12 ++---
.../jaxrs/xml/annotation/JacksonFeatures.java | 2 +-
15 files changed, 204 insertions(+), 96 deletions(-)
diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java
index 03930f8..ee8131d 100644
--- a/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java
+++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java
@@ -75,7 +75,7 @@ public abstract class ProviderBase<
* (never try to serialize instances of these types).
*/
public final static Class<?>[] DEFAULT_UNWRITABLES = new Class<?>[] {
- InputStream.class, // as per [Issue#19]
+ InputStream.class, // as per [Issue#19]
OutputStream.class, Writer.class,
StreamingOutput.class, Response.class
};
@@ -112,7 +112,7 @@ public abstract class ProviderBase<
/**
* Feature flags set.
*
- * @since 2.3.0
+ * @since 2.3
*/
protected int _jaxRSFeatures;
@@ -125,6 +125,20 @@ public abstract class ProviderBase<
* View to use for writing if none defined for the end point.
*/
protected Class<?> _defaultWriteView;
+
+ /**
+ * Object used for handling possible {@link ObjectReader} injection.
+ *
+ * @since 2.3
+ */
+ protected ObjectReaderInjector _readerInjector;
+
+ /**
+ * Object used for handling possible {@link ObjectWriter} injection.
+ *
+ * @since 2.3
+ */
+ protected ObjectWriterInjector _writerInjector;
/*
/**********************************************************
@@ -176,6 +190,8 @@ public abstract class ProviderBase<
protected ProviderBase(MAPPER_CONFIG mconfig) {
_mapperConfig = mconfig;
+ _readerInjector = new ObjectReaderInjector();
+ _writerInjector = new ObjectWriterInjector();
}
/**
@@ -446,11 +462,43 @@ public abstract class ProviderBase<
protected abstract MAPPER _locateMapperViaProvider(Class<?> type, MediaType mediaType);
- protected abstract EP_CONFIG _configForReading(MAPPER mapper,
- Annotation[] annotations, Class<?> defaultView);
+ protected EP_CONFIG _configForReading(MAPPER mapper,
+ Annotation[] annotations, Class<?> defaultView)
+ {
+ ObjectReader r = _readerInjector.getAndClear();
+ if (r == null) {
+ if (defaultView != null) {
+ r = mapper.readerWithView(defaultView);
+ } else {
+ r = mapper.reader();
+ }
+ } else {
+ r = r.withView(defaultView);
+ }
+ return _configForReading(r, annotations);
+ }
+
+ protected EP_CONFIG _configForWriting(MAPPER mapper,
+ Annotation[] annotations, Class<?> defaultView)
+ {
+ ObjectWriter w = _writerInjector.getAndClear();
+ if (w == null) {
+ if (defaultView != null) {
+ w = mapper.writerWithView(defaultView);
+ } else {
+ w = mapper.writer();
+ }
+ } else {
+ w = w.withView(defaultView);
+ }
+ return _configForWriting(w, annotations);
+ }
+
+ protected abstract EP_CONFIG _configForReading(ObjectReader reader,
+ Annotation[] annotations);
- protected abstract EP_CONFIG _configForWriting(MAPPER mapper,
- Annotation[] annotations, Class<?> defaultView);
+ protected abstract EP_CONFIG _configForWriting(ObjectWriter writer,
+ Annotation[] annotations);
/*
/**********************************************************
diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java
index 465ca85..f698939 100644
--- a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java
+++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/EndpointConfigBase.java
@@ -5,9 +5,9 @@ import java.lang.annotation.Annotation;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
+
import com.fasterxml.jackson.databind.*;
+
import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
/**
@@ -84,72 +84,43 @@ public abstract class EndpointConfigBase<THIS extends EndpointConfigBase<THIS>>
}
}
- /**
- * @deprecated Since 2.3
- */
- @Deprecated
- protected THIS initReader(ObjectMapper mapper) {
- return initReader(mapper, null);
- }
-
@SuppressWarnings("unchecked")
- protected THIS initReader(ObjectMapper mapper, Class<?> defaultView)
+ protected THIS initReader(ObjectReader reader)
{
- // first common config
- Class<?> view = _activeView;
- if (view == null) {
- view = defaultView;
- }
- if (view != null) {
- _reader = mapper.readerWithView(view);
- } else {
- _reader = mapper.reader();
+ if (_activeView != null) {
+ reader = reader.withView(_activeView);
}
-
if (_rootName != null) {
- _reader = _reader.withRootName(_rootName);
+ reader = reader.withRootName(_rootName);
}
// Then deser features
if (_deserEnable != null) {
- _reader = _reader.withFeatures(_deserEnable);
+ reader = reader.withFeatures(_deserEnable);
}
if (_deserDisable != null) {
- _reader = _reader.withoutFeatures(_deserDisable);
+ reader = reader.withoutFeatures(_deserDisable);
}
+ _reader = reader;
return (THIS) this;
}
-
- /**
- * @deprecated Since 2.3
- */
- @Deprecated
- protected THIS initWriter(ObjectMapper mapper) {
- return initWriter(mapper, null);
- }
@SuppressWarnings("unchecked")
- protected THIS initWriter(ObjectMapper mapper, Class<?> defaultView)
+ protected THIS initWriter(ObjectWriter writer)
{
- // first common config
- Class<?> view = _activeView;
- if (view == null) {
- view = defaultView;
- }
- if (view != null) {
- _writer = mapper.writerWithView(view);
- } else {
- _writer = mapper.writer();
+ if (_activeView != null) {
+ writer = writer.withView(_activeView);
}
if (_rootName != null) {
- _writer = _writer.withRootName(_rootName);
+ writer = writer.withRootName(_rootName);
}
// Then features
if (_serEnable != null) {
- _writer = _writer.withFeatures(_serEnable);
+ writer = writer.withFeatures(_serEnable);
}
if (_serDisable != null) {
- _writer = _writer.withoutFeatures(_serDisable);
+ writer = writer.withoutFeatures(_serDisable);
}
+ _writer = writer;
return (THIS) this;
}
diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/JaxRSFeature.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/JaxRSFeature.java
index 669b4e9..9e415fb 100644
--- a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/JaxRSFeature.java
+++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/JaxRSFeature.java
@@ -30,7 +30,7 @@ public enum JaxRSFeature implements ConfigFeature
/* Other
/******************************************************
*/
-
+
;
private final boolean _defaultState;
diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/ObjectReaderInjector.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/ObjectReaderInjector.java
new file mode 100644
index 0000000..4bbbb75
--- /dev/null
+++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/ObjectReaderInjector.java
@@ -0,0 +1,44 @@
+package com.fasterxml.jackson.jaxrs.cfg;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import com.fasterxml.jackson.databind.*;
+
+/**
+ * Based on ideas from [Issue#32], this class allows "overriding" of {@link ObjectReader}
+ * that JAX-RS Resource will use; usually this is done from a Servlet or JAX-RS filter
+ * before execution reaches resource.
+ *
+ * @author apemberton at github, Tatu Saloranta
+ *
+ * @since 2.3
+ */
+public class ObjectReaderInjector
+{
+ protected static final ThreadLocal<ObjectReader> _threadLocal = new ThreadLocal<ObjectReader>();
+
+ /**
+ * Simple marker used to optimize out {@link ThreadLocal} access in cases
+ * where this feature is not being used
+ */
+ protected final AtomicBoolean _hasBeenSet = new AtomicBoolean(false);
+
+ public ObjectReaderInjector() { }
+
+ public void set(ObjectReader r) {
+ _hasBeenSet.set(true);
+ _threadLocal.set(r);
+ }
+
+ public ObjectReader get() {
+ return _hasBeenSet.get() ? _threadLocal.get() : null;
+ }
+
+ public ObjectReader getAndClear() {
+ ObjectReader r = get();
+ if (r != null) {
+ _threadLocal.remove();
+ }
+ return r;
+ }
+}
diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/ObjectWriterInjector.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/ObjectWriterInjector.java
new file mode 100644
index 0000000..8113aac
--- /dev/null
+++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/cfg/ObjectWriterInjector.java
@@ -0,0 +1,44 @@
+package com.fasterxml.jackson.jaxrs.cfg;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import com.fasterxml.jackson.databind.*;
+
+/**
+ * Based on ideas from [Issue#32], this class allows "overriding" of {@link ObjectWriter}
+ * that JAX-RS Resource will use; usually this is done from a Servlet or JAX-RS filter
+ * before execution reaches resource.
+ *
+ * @author apemberton at github, Tatu Saloranta
+ *
+ * @since 2.3
+ */
+public class ObjectWriterInjector
+{
+ protected static final ThreadLocal<ObjectWriter> _threadLocal = new ThreadLocal<ObjectWriter>();
+
+ /**
+ * Simple marker used to optimize out {@link ThreadLocal} access in cases
+ * where this feature is not being used
+ */
+ protected final AtomicBoolean _hasBeenSet = new AtomicBoolean(false);
+
+ public ObjectWriterInjector() { }
+
+ public void set(ObjectWriter r) {
+ _hasBeenSet.set(true);
+ _threadLocal.set(r);
+ }
+
+ public ObjectWriter get() {
+ return _hasBeenSet.get() ? _threadLocal.get() : null;
+ }
+
+ public ObjectWriter getAndClear() {
+ ObjectWriter w = get();
+ if (w != null) {
+ _threadLocal.remove();
+ }
+ return w;
+ }
+}
diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/util/EndpointAsBeanProperty.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/util/EndpointAsBeanProperty.java
index 530809b..0780f72 100644
--- a/base/src/main/java/com/fasterxml/jackson/jaxrs/util/EndpointAsBeanProperty.java
+++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/util/EndpointAsBeanProperty.java
@@ -4,6 +4,8 @@ import java.lang.annotation.Annotation;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.PropertyMetadata;
+import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.introspect.AnnotationMap;
/**
@@ -17,7 +19,7 @@ import com.fasterxml.jackson.databind.introspect.AnnotationMap;
public class EndpointAsBeanProperty
extends BeanProperty.Std
{
- public final static String ENDPOINT_NAME = "JAX-RS/endpoint";
+ public final static PropertyName ENDPOINT_NAME = new PropertyName("JAX-RS/endpoint");
private final static AnnotationMap NO_ANNOTATIONS = new AnnotationMap();
@@ -27,8 +29,7 @@ public class EndpointAsBeanProperty
{
// TODO: find and pass wrapper; isRequired marker?
super(ENDPOINT_NAME, type, /*PropertyName wrapperName*/ null,
- null, null,
- /* isRequired */ false);
+ null, null, PropertyMetadata.STD_OPTIONAL);
boolean hasAnn = (annotations != null && annotations.length > 0);
if (hasAnn) {
_annotations = new AnnotationMap();
diff --git a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java
index 4724d30..933ec1a 100644
--- a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java
+++ b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java
@@ -217,15 +217,15 @@ public class JacksonJsonProvider
}
@Override
- protected JsonEndpointConfig _configForReading(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView) {
- return JsonEndpointConfig.forReading(mapper, annotations, defaultView);
+ protected JsonEndpointConfig _configForReading(ObjectReader reader,
+ Annotation[] annotations) {
+ return JsonEndpointConfig.forReading(reader, annotations);
}
@Override
- protected JsonEndpointConfig _configForWriting(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView) {
- return JsonEndpointConfig.forWriting(mapper, annotations, defaultView,
+ protected JsonEndpointConfig _configForWriting(ObjectWriter writer,
+ Annotation[] annotations) {
+ return JsonEndpointConfig.forWriting(writer, annotations,
_jsonpFunctionName);
}
}
diff --git a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java
index 8a000de..61fbc4e 100644
--- a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java
+++ b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JsonEndpointConfig.java
@@ -28,16 +28,16 @@ public class JsonEndpointConfig
protected JsonEndpointConfig() { }
- public static JsonEndpointConfig forReading(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView)
+ public static JsonEndpointConfig forReading(ObjectReader reader,
+ Annotation[] annotations)
{
return new JsonEndpointConfig()
.add(annotations, false)
- .initReader(mapper, defaultView);
+ .initReader(reader);
}
- public static JsonEndpointConfig forWriting(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView,
+ public static JsonEndpointConfig forWriting(ObjectWriter writer,
+ Annotation[] annotations,
String defaultJsonpMethod)
{
JsonEndpointConfig config = new JsonEndpointConfig();
@@ -46,7 +46,7 @@ public class JsonEndpointConfig
}
return config
.add(annotations, true)
- .initWriter(mapper, defaultView)
+ .initWriter(writer)
;
}
diff --git a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java
index a7216f6..f801397 100644
--- a/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java
+++ b/json/src/main/java/com/fasterxml/jackson/jaxrs/json/annotation/JacksonFeatures.java
@@ -12,7 +12,7 @@ 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.
*
- * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonAnnotation} instead
+ * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures} instead
*/
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
diff --git a/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/JacksonSmileProvider.java b/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/JacksonSmileProvider.java
index 68e82a9..76138b7 100644
--- a/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/JacksonSmileProvider.java
+++ b/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/JacksonSmileProvider.java
@@ -207,14 +207,14 @@ extends ProviderBase<JacksonSmileProvider,
}
@Override
- protected SmileEndpointConfig _configForReading(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView) {
- return SmileEndpointConfig.forReading(mapper, annotations, defaultView);
+ protected SmileEndpointConfig _configForReading(ObjectReader reader,
+ Annotation[] annotations) {
+ return SmileEndpointConfig.forReading(reader, annotations);
}
@Override
- protected SmileEndpointConfig _configForWriting(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView) {
- return SmileEndpointConfig.forWriting(mapper, annotations, defaultView);
+ protected SmileEndpointConfig _configForWriting(ObjectWriter writer,
+ Annotation[] annotations) {
+ return SmileEndpointConfig.forWriting(writer, annotations);
}
}
diff --git a/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/SmileEndpointConfig.java b/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/SmileEndpointConfig.java
index 9688fac..6e52811 100644
--- a/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/SmileEndpointConfig.java
+++ b/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/SmileEndpointConfig.java
@@ -20,23 +20,23 @@ public class SmileEndpointConfig
protected SmileEndpointConfig() { }
- public static SmileEndpointConfig forReading(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView)
+ public static SmileEndpointConfig forReading(ObjectReader reader,
+ Annotation[] annotations)
{
return new SmileEndpointConfig()
.add(annotations, false)
- .initReader(mapper, defaultView)
- ;
+ .initReader(reader)
+ ;
}
- public static SmileEndpointConfig forWriting(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView)
+ public static SmileEndpointConfig forWriting(ObjectWriter writer,
+ Annotation[] annotations)
{
SmileEndpointConfig config = new SmileEndpointConfig();
return config
.add(annotations, true)
- .initWriter(mapper, defaultView)
- ;
+ .initWriter(writer)
+ ;
}
@SuppressWarnings("deprecation")
diff --git a/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/annotation/JacksonFeatures.java b/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/annotation/JacksonFeatures.java
index 6c5ce6d..30e5acd 100644
--- a/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/annotation/JacksonFeatures.java
+++ b/smile/src/main/java/com/fasterxml/jackson/jaxrs/smile/annotation/JacksonFeatures.java
@@ -12,7 +12,7 @@ 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.
*
- * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonAnnotation} instead
+ * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures} instead
*/
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
diff --git a/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/JacksonXMLProvider.java b/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/JacksonXMLProvider.java
index fdcc637..71aed35 100644
--- a/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/JacksonXMLProvider.java
+++ b/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/JacksonXMLProvider.java
@@ -132,15 +132,15 @@ public class JacksonXMLProvider
*/
@Override
- protected XMLEndpointConfig _configForReading(XmlMapper mapper,
- Annotation[] annotations, Class<?> defaultView) {
- return XMLEndpointConfig.forReading(mapper, annotations, defaultView);
+ protected XMLEndpointConfig _configForReading(ObjectReader reader,
+ Annotation[] annotations) {
+ return XMLEndpointConfig.forReading(reader, annotations);
}
@Override
- protected XMLEndpointConfig _configForWriting(XmlMapper mapper,
- Annotation[] annotations, Class<?> defaultView) {
- return XMLEndpointConfig.forWriting(mapper, annotations, defaultView);
+ protected XMLEndpointConfig _configForWriting(ObjectWriter writer,
+ Annotation[] annotations) {
+ return XMLEndpointConfig.forWriting(writer, annotations);
}
/**
diff --git a/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/XMLEndpointConfig.java b/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/XMLEndpointConfig.java
index f00e380..d29803b 100644
--- a/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/XMLEndpointConfig.java
+++ b/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/XMLEndpointConfig.java
@@ -21,21 +21,21 @@ public class XMLEndpointConfig
protected XMLEndpointConfig() { }
- public static XMLEndpointConfig forReading(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView)
+ public static XMLEndpointConfig forReading(ObjectReader reader,
+ Annotation[] annotations)
{
return new XMLEndpointConfig()
.add(annotations, false)
- .initReader(mapper, defaultView);
+ .initReader(reader);
}
- public static XMLEndpointConfig forWriting(ObjectMapper mapper,
- Annotation[] annotations, Class<?> defaultView)
+ public static XMLEndpointConfig forWriting(ObjectWriter writer,
+ Annotation[] annotations)
{
XMLEndpointConfig config = new XMLEndpointConfig();
return config
.add(annotations, true)
- .initWriter(mapper, defaultView)
+ .initWriter(writer)
;
}
diff --git a/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/annotation/JacksonFeatures.java b/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/annotation/JacksonFeatures.java
index a3834fe..f1fb5c7 100644
--- a/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/annotation/JacksonFeatures.java
+++ b/xml/src/main/java/com/fasterxml/jackson/jaxrs/xml/annotation/JacksonFeatures.java
@@ -12,7 +12,7 @@ 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.
*
- * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonAnnotation} instead
+ * @deprecated Since 2.2, use shared {@link com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures} instead
*/
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jackson-jaxrs-providers.git
More information about the pkg-java-commits
mailing list