use of com.fasterxml.jackson.core.Version in project hadoop by apache.
the class StatePool method read.
private void read(DataInput in) throws IOException {
ObjectMapper mapper = new ObjectMapper();
// define a module
SimpleModule module = new SimpleModule("State Serializer", new Version(0, 1, 1, "FINAL", "", ""));
// add the state deserializer
module.addDeserializer(StatePair.class, new StateDeserializer());
// register the module with the object-mapper
mapper.registerModule(module);
JsonParser parser = mapper.getFactory().createParser((DataInputStream) in);
StatePool statePool = mapper.readValue(parser, StatePool.class);
this.setStates(statePool.getStates());
parser.close();
}
use of com.fasterxml.jackson.core.Version in project Gaffer by gchq.
the class HyperLogLogPlusJsonSerialisationTest method before.
@Before
public void before() {
mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
final SimpleModule module = new SimpleModule(HyperLogLogPlusJsonConstants.HYPER_LOG_LOG_PLUS_SERIALISER_MODULE_NAME, new Version(1, 0, 0, null));
module.addSerializer(HyperLogLogPlus.class, new HyperLogLogPlusJsonSerialiser());
module.addDeserializer(HyperLogLogPlus.class, new HyperLogLogPlusJsonDeserialiser());
mapper.registerModule(module);
}
use of com.fasterxml.jackson.core.Version in project midpoint by Evolveum.
the class JsonLexicalProcessor method createSerializerModule.
private Module createSerializerModule() {
SimpleModule module = new SimpleModule("MidpointModule", new Version(0, 0, 0, "aa"));
module.addSerializer(QName.class, new QNameSerializer());
module.addSerializer(PolyString.class, new PolyStringSerializer());
module.addSerializer(ItemPath.class, new ItemPathSerializer());
module.addSerializer(ItemPathType.class, new ItemPathTypeSerializer());
module.addSerializer(XMLGregorianCalendar.class, new XmlGregorianCalendarSerializer());
// module.addSerializer(JAXBElement.class, new JaxbElementSerializer());
return module;
}
use of com.fasterxml.jackson.core.Version in project jackson-databind by FasterXML.
the class TestVersions method assertVersion.
/*
/**********************************************************
/* Helper methods
/**********************************************************
*/
private void assertVersion(Versioned vers) {
Version v = vers.version();
assertFalse("Should find version information (got " + v + ")", v.isUnknownVersion());
Version exp = PackageVersion.VERSION;
assertEquals(exp.toFullString(), v.toFullString());
assertEquals(exp, v);
}
use of com.fasterxml.jackson.core.Version in project jackson-module-afterburner by FasterXML.
the class TestVersions method assertVersion.
/*
/**********************************************************
/* Helper methods
/**********************************************************
*/
private void assertVersion(Versioned vers) {
Version v = vers.version();
assertFalse("Should find version information (got " + v + ")", v.isUnknownVersion());
Version exp = PackageVersion.VERSION;
assertEquals(exp.toFullString(), v.toFullString());
assertEquals(exp, v);
}
Aggregations