Package org.glassfish.jersey.jackson

Examples of org.glassfish.jersey.jackson.JacksonFeature


      WRAPPED_MAPPER.enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
      WRAPPED_MAPPER.enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
      WRAPPED_MAPPER.disable(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES);
      WRAPPED_MAPPER.enable(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
     
      CLIENT.register(new JacksonFeature()).register(new ContextResolver<ObjectMapper>() {

        public ObjectMapper getContext(Class<?> type) {
          return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER;
        }
       
View Full Code Here


        client = createHttpClient();
    }

    private Client createHttpClient() {
        ClientConfig clientConfig = new ClientConfig()
                .register(new JacksonFeature())
                .connectorProvider(new ApacheConnectorProvider());
        if (Boolean.parseBoolean(System.getProperty("proxySet"))) {
            clientConfig.property(ClientProperties.PROXY_URI, "http://" + System.getProperty("http.proxyHost") + ":" + System.getProperty("http.proxyPort"));
        }
        return ClientBuilder.newClient(clientConfig);
View Full Code Here

    public static Client getJerseyClient() {
        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = ClientFactory.newClient();
            JERSEY_CLIENT.register(new CsrfProtectionFilter())
                    .register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
    }
View Full Code Here

    public static Client getJerseyClient() {
        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = ClientBuilder.newClient();
            JERSEY_CLIENT.register(new CsrfProtectionFilter())
                    .register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
    }
View Full Code Here

    public static synchronized Client getJerseyClient() {
        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = initialize(ClientBuilder.newBuilder()).build();
            JERSEY_CLIENT.register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
    }
View Full Code Here

        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = ClientFactory.newClient();
            JERSEY_CLIENT.configuration()
                    .register(new CsrfProtectionFilter())
                    .register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
    }
View Full Code Here

    public static Client getJerseyClient() {
        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = ClientBuilder.newClient();
            JERSEY_CLIENT.register(new CsrfProtectionFilter())
                    .register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
    }
View Full Code Here

    public static Client getJerseyClient() {
        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = initialize(ClientBuilder.newBuilder()).build();
            JERSEY_CLIENT.register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
    }
View Full Code Here

        super();
    }

    @Override
    public Feature getJsonFeature() {
        return new JacksonFeature();
    }
View Full Code Here

        return App.createApp();
    }

    @Override
    protected void configureClient(ClientConfig config) {
        config.register(new JacksonFeature()).register(MyObjectMapperProvider.class);
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.jackson.JacksonFeature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.