com.fasterxml.jackson.jaxrs.yaml.YAMLEndpointConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-jaxrs-yaml-provider Show documentation
Show all versions of jackson-jaxrs-yaml-provider Show documentation
Functionality to handle YAML input/output for JAX-RS implementations (like Jersey and RESTeasy)
using standard Jackson data binding.
package com.fasterxml.jackson.jaxrs.yaml;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.cfg.MapperConfig;
import com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase;
import java.lang.annotation.Annotation;
/**
* Container class for figuring out annotation-based configuration
* for JAX-RS end points.
*/
public class YAMLEndpointConfig
extends EndpointConfigBase
{
/*
/**********************************************************
/* Construction
/**********************************************************
*/
protected YAMLEndpointConfig(MapperConfig> config) {
super(config);
}
public static YAMLEndpointConfig forReading(ObjectReader reader,
Annotation[] annotations) {
return new YAMLEndpointConfig(reader.getConfig())
.add(annotations, false)
.initReader(reader);
}
public static YAMLEndpointConfig forWriting(ObjectWriter writer,
Annotation[] annotations) {
return new YAMLEndpointConfig(writer.getConfig())
.add(annotations, true)
.initWriter(writer)
;
}
@Override
public Object modifyBeforeWrite(Object value) {
// nothing to add
return value;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy