Search in sources :

Example 1 with MidpointYAMLGenerator

use of com.evolveum.midpoint.prism.lex.json.yaml.MidpointYAMLGenerator in project midpoint by Evolveum.

the class YamlLexicalProcessor method createJacksonGenerator.

public YAMLGenerator createJacksonGenerator(StringWriter out) throws SchemaException {
    try {
        MidpointYAMLFactory factory = new MidpointYAMLFactory();
        MidpointYAMLGenerator generator = (MidpointYAMLGenerator) factory.createGenerator(out);
        generator.setPrettyPrinter(new DefaultPrettyPrinter());
        generator.setCodec(configureMapperForSerialization());
        return generator;
    } catch (IOException ex) {
        throw new SchemaException("Schema error during serializing to JSON.", ex);
    }
}
Also used : DefaultPrettyPrinter(com.fasterxml.jackson.core.util.DefaultPrettyPrinter) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) MidpointYAMLGenerator(com.evolveum.midpoint.prism.lex.json.yaml.MidpointYAMLGenerator) MidpointYAMLFactory(com.evolveum.midpoint.prism.lex.json.yaml.MidpointYAMLFactory) IOException(java.io.IOException)

Aggregations

MidpointYAMLFactory (com.evolveum.midpoint.prism.lex.json.yaml.MidpointYAMLFactory)1 MidpointYAMLGenerator (com.evolveum.midpoint.prism.lex.json.yaml.MidpointYAMLGenerator)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 DefaultPrettyPrinter (com.fasterxml.jackson.core.util.DefaultPrettyPrinter)1 IOException (java.io.IOException)1