use of org.apache.johnzon.mapper.access.FieldAccessMode in project tomee by apache.
the class TomEEJsonbProviderTest method service.
@Module
public static EjbModule service() {
final EjbModule module = new EjbModule(new EjbJar(), new OpenejbJar());
final EnterpriseBean bean = new SingletonBean(Endpoint.class).localBean();
module.getEjbJar().addEnterpriseBean(bean);
final Resources resources = new Resources();
final Service configuredTomEEJsonbProvider = new Service("configuredTomEEJsonbProvider", null);
configuredTomEEJsonbProvider.setClassName(TomEEJsonbProvider.class.getName());
configuredTomEEJsonbProvider.getProperties().put("dateFormat", "MMM-yyyy");
configuredTomEEJsonbProvider.getProperties().put("locale", Locale.GERMANY);
configuredTomEEJsonbProvider.getProperties().put("accessMode", new FieldAccessMode(true, true));
resources.getService().add(configuredTomEEJsonbProvider);
module.initResources(resources);
final PojoDeployment e = new PojoDeployment();
e.setClassName("jaxrs-application");
e.getProperties().setProperty("cxf.jaxrs.providers", "configuredTomEEJsonbProvider");
module.getOpenejbJar().getPojoDeployment().add(e);
return module;
}
Aggregations