Search in sources :

Example 1 with SchemaTypeAbstractSerializer

use of org.gluu.oxtrust.service.scim2.schema.strategy.serializers.SchemaTypeAbstractSerializer in project oxTrust by GluuFederation.

the class SchemaWebService method serialize.

private String serialize(Serializable serializable) throws Exception {
    ObjectMapper mapper = new ObjectMapper();
    mapper.disable(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS);
    SimpleModule customSchemaTypeAstractModule = new SimpleModule("CustomSchemaTypeAbstractModule", new Version(1, 0, 0, ""));
    SchemaTypeAbstractSerializer serializer = new SchemaTypeAbstractSerializer();
    customSchemaTypeAstractModule.addSerializer(SchemaType.class, serializer);
    mapper.registerModule(customSchemaTypeAstractModule);
    return mapper.writeValueAsString(serializable);
}
Also used : SchemaTypeAbstractSerializer(org.gluu.oxtrust.service.scim2.schema.strategy.serializers.SchemaTypeAbstractSerializer) Version(org.codehaus.jackson.Version) ObjectMapper(org.codehaus.jackson.map.ObjectMapper) SimpleModule(org.codehaus.jackson.map.module.SimpleModule)

Aggregations

Version (org.codehaus.jackson.Version)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 SimpleModule (org.codehaus.jackson.map.module.SimpleModule)1 SchemaTypeAbstractSerializer (org.gluu.oxtrust.service.scim2.schema.strategy.serializers.SchemaTypeAbstractSerializer)1