/**
 * Copyright (C) 2012 Ness Computing, Inc.
 *
 * Licensed 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 com.nesscomputing.jersey.json;

import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.ext.Provider;

import org.codehaus.jackson.jaxrs.JacksonJsonProvider;

import com.google.inject.Singleton;

/**
 * Jersey Provider class that allows Jackson to serialize any media type starting
 * with <code>x-ness</code>.  By default, only types that end with <code>+json</code> will
 * be matched.
 */
@Provider
@Produces("x-ness/*")
@Consumes("x-ness/*")
@Singleton
public class NessJacksonJsonProvider extends JacksonJsonProvider
{ }

@@ -653,88 +653,480 @@
 java
-x.ws.rs.Consumes;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.ext.Provider;%0A
+.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Type;%0A%0Aimport javax.ws.rs.Consumes;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.MultivaluedMap;%0Aimport javax.ws.rs.ext.MessageBodyReader;%0Aimport javax.ws.rs.ext.MessageBodyWriter;%0Aimport javax.ws.rs.ext.Provider;%0A%0Aimport org.codehaus.jackson.Version;%0Aimport org.codehaus.jackson.Versioned;
 %0Aimp
@@ -1174,24 +1174,57 @@
 nProvider;%0A%0A
+import com.google.inject.Inject;%0A
 import com.g
@@ -1550,36 +1550,1817 @@
 der 
-extends JacksonJsonProvider%0A%7B 
+implements MessageBodyReader%3CObject%3E, MessageBodyWriter%3CObject%3E, Versioned%0A%7B%0A    private final JacksonJsonProvider delegate;%0A%0A    @Inject%0A    NessJacksonJsonProvider(JacksonJsonProvider delegate)%0A    %7B%0A        this.delegate = delegate;%0A    %7D%0A%0A    @Override%0A    public Version version()%0A    %7B%0A        return delegate.version();%0A    %7D%0A%0A    @Override%0A    public boolean isReadable(Class%3C?%3E type, Type genericType, Annotation%5B%5D annotations, MediaType mediaType)%0A    %7B%0A        return delegate.isReadable(type, genericType, annotations, mediaType);%0A    %7D%0A%0A    @Override%0A    public Object readFrom(Class%3CObject%3E type, Type genericType, Annotation%5B%5D annotations, MediaType mediaType,%0A            MultivaluedMap%3CString, String%3E httpHeaders, InputStream entityStream) throws IOException%0A    %7B%0A        return delegate.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream);%0A    %7D%0A%0A    @Override%0A    public long getSize(Object value, Class%3C?%3E type, Type genericType, Annotation%5B%5D annotations, MediaType mediaType)%0A    %7B%0A        return delegate.getSize(value, type, genericType, annotations, mediaType);%0A    %7D%0A%0A    @Override%0A    public boolean isWriteable(Class%3C?%3E type, Type genericType, Annotation%5B%5D annotations, MediaType mediaType)%0A    %7B%0A        return delegate.isWriteable(type, genericType, annotations, mediaType);%0A    %7D%0A%0A    @Override%0A    public void writeTo(Object value, Class%3C?%3E type, Type genericType, Annotation%5B%5D annotations, MediaType mediaType,%0A            MultivaluedMap%3CString, Object%3E httpHeaders, OutputStream entityStream) throws IOException%0A    %7B%0A        delegate.writeTo(value, type, genericType, annotations, mediaType, httpHeaders, entityStream);%0A    %7D%0A%0A    @Override%0A    public String toString()%0A    %7B%0A        return %22NessJacksonJsonProvider: %22 + delegate.toString();%0A    %7D%0A
 %7D%0A

Convert NessJacksonJsonProvider to use a delegate rather than extending, so that if you configure the JacksonJsonProvider directly it also affects the NessJacksonJsonProvider