Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Examples/MOXy/MOXy JSON Provider

< EclipseLink‎ | Examples‎ | MOXy
Revision as of 16:13, 15 June 2012 by Rick.barkhouse.oracle.com (Talk | contribs) (New page: = MOXy JSON Provider = MOXy now includes an implementation (MOXyJsonProvider) that can be used directly or extended to make the integration even easier. == Using MOXyJsonProvider == ===...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MOXy JSON Provider

MOXy now includes an implementation (MOXyJsonProvider) that can be used directly or extended to make the integration even easier.

Using MOXyJsonProvider

Default Behaviour

You can use a JAX-RS Application class to specify that MOXyJsonProvider should be used with your JAX-RS application.

package org.example;
 
import java.util.*;
import javax.ws.rs.core.Application;
import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
 
public class CustomerApplication  extends Application {
 
    @Override
    public Set<Class<?>> getClasses() {
        HashSet<Class<?>> set = new HashSet<Class<?>>(2);
        set.add(MOXyJsonProvider.class);
        set.add(CustomerService.class);
        return set;
    }
 
}

Copyright © Eclipse Foundation, Inc. All Rights Reserved.