Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ext;
 import java.util.Map;
Provider for serializers of XML types that are part of full JDK 1.5, but that some alleged 1.5 platforms are missing (Android, GAE). And for this reason these are added using more dynamic mechanism.

Note: since many of classes defined are abstract, caller must take care not to just use straight equivalency check but rather consider subclassing as well.

public class CoreXMLSerializers
    implements Provider<Map.Entry<Class<?>,JsonSerializer<?>>>
    final static HashMap<Class<?>,JsonSerializer<?>> _serializers = new HashMap<Class<?>,JsonSerializer<?>>();
We will construct instances statically, during class loading, to try to make things fail-fast, i.e. to catch problems as soon as possible.
    static {
//    @Override
    public Collection<Map.Entry<Class<?>,JsonSerializer<?>>> provide() {
        return .entrySet();
    public static class XMLGregorianCalendarSerializer extends StdSerializer<XMLGregorianCalendar>
        public XMLGregorianCalendarSerializer() {
        public void serialize(XMLGregorianCalendar valueJsonGenerator jgenSerializerProvider provider)
                throws IOExceptionJsonGenerationException {
            ..serialize(value.toGregorianCalendar(), jgenprovider);
        public JsonNode getSchema(SerializerProvider providerType typeHintthrows JsonMappingException {
            return ..getSchema(providertypeHint);
        public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitorJavaType typeHint) {
New to GrepCode? Check out our FAQ X