Examples of MoxyJsonConfig


Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

     */
    public static class JsonConfiguration implements ContextResolver<MoxyJsonConfig> {

        @Override
        public MoxyJsonConfig getContext(final Class<?> type) {
            final MoxyJsonConfig config = new MoxyJsonConfig();
            config.setFormattedOutput(true);
            return config;
        }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

    private MoxyJsonConfig globalConfig;

    private MoxyJsonConfig getGlobalConfig() {
        if (globalConfig == null) {
            globalConfig = new MoxyJsonConfig()
                    .setMarshallerProperties(getConfigProperties(config, MARSHALLER_PROPERTY_NAMES))
                    .setUnmarshallerProperties(getConfigProperties(config, UNMARSHALLER_PROPERTY_NAMES));
        }
        return globalConfig;
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

                forMarshaller ? getGlobalConfig().getMarshallerProperties() : getGlobalConfig().getUnmarshallerProperties());

        final ContextResolver<MoxyJsonConfig> contextResolver =
                providers.getContextResolver(MoxyJsonConfig.class, MediaType.APPLICATION_JSON_TYPE);
        if (contextResolver != null) {
            final MoxyJsonConfig jsonConfiguration = contextResolver.getContext(MoxyJsonConfig.class);

            if (jsonConfiguration != null) {
                properties.putAll(forMarshaller ?
                        jsonConfiguration.getMarshallerProperties() : jsonConfiguration.getUnmarshallerProperties());
            }
        }

        return properties;
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

     * for this application.
     *
     * @return {@code MoxyJsonConfig} context resolver.
     */
    public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
        final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig()
                .setFormattedOutput(true)
                .setNamespaceSeparator(':');
        return moxyJsonConfig.resolver();
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

        // Register entity-filtering selectable feature.
        register(SelectableEntityFilteringFeature.class);

        // Configure MOXy Json provider.
        register(new MoxyJsonConfig().setFormattedOutput(true).resolver());
       
        property(SelectableEntityFilteringFeature.QUERY_PARAM_NAME, "select");

    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

        // Entity Data Filtering feature.
        register(EntityFilteringFeature.class);

        // Configure MOXy Json provider.
        register(new MoxyJsonConfig().setFormattedOutput(true).resolver());
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

     * Create {@link ContextResolver} for {@link MoxyJsonConfig} for this application.
     *
     * @return {@code MoxyJsonConfig} context resolver.
     */
    public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
        final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig()
                .setFormattedOutput(true)
                .setNamespaceSeparator(':');
        return moxyJsonConfig.resolver();
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

     * Create MOXy JSON config context resolver.
     *
     * @return new MOXy JSON config context resolver.
     */
    public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
        final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig();
        Map<String, String> namespacePrefixMapper = new HashMap<String, String>(1);
        namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
        moxyJsonConfig.setNamespacePrefixMapper(namespacePrefixMapper).setNamespaceSeparator(':');
        return moxyJsonConfig.resolver();
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

                packages("org.glassfish.jersey.tests.performance.tools").
                register(createMoxyJsonResolver());
    }

    public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
        final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig();
        final Map<String, String> namespacePrefixMapper = new HashMap<>(1);
        namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
        moxyJsonConfig.setNamespacePrefixMapper(namespacePrefixMapper).setNamespaceSeparator(':');
        return moxyJsonConfig.resolver();
    }
View Full Code Here

Examples of org.glassfish.jersey.moxy.json.MoxyJsonConfig

                packages("org.glassfish.jersey.examples.jsonmoxy").
                register(createMoxyJsonResolver());
    }

    public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
        final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig();
        Map<String, String> namespacePrefixMapper = new HashMap<String, String>(1);
        namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
        moxyJsonConfig.setNamespacePrefixMapper(namespacePrefixMapper).setNamespaceSeparator(':');
        return moxyJsonConfig.resolver();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.