Java Code Examples for com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper#expectAnyFormat()

The following examples show how to use com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper#expectAnyFormat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsonSerializer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Default implementation simply calls {@link JsonFormatVisitorWrapper#expectAnyFormat(JavaType)}.
 * 
 * @since 2.1
 */
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType type)
    throws JsonMappingException
{
    visitor.expectAnyFormat(type);
}
 
Example 2
Source File: TokenBufferSerializer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    // Not 100% sure what we should say here: type is basically not known.
    // This seems like closest approximation
    visitor.expectAnyFormat(typeHint);
}
 
Example 3
Source File: JsonValueSerializer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    /* 27-Apr-2015, tatu: First things first; for JSON Schema introspection,
     *    Enum types that use `@JsonValue` are special (but NOT necessarily
     *    anything else that RETURNS an enum!)
     *    So we will need to add special
     *    handling here (see https://github.com/FasterXML/jackson-module-jsonSchema/issues/57
     *    for details).
     *    
     *    Note that meaning of JsonValue, then, is very different for Enums. Sigh.
     */
    final JavaType type = _accessor.getType();
    Class<?> declaring = _accessor.getDeclaringClass();
    if ((declaring != null) && declaring.isEnum()) {
        if (_acceptJsonFormatVisitorForEnum(visitor, typeHint, declaring)) {
            return;
        }
    }
    JsonSerializer<Object> ser = _valueSerializer;
    if (ser == null) {
        ser = visitor.getProvider().findTypedValueSerializer(type, false, _property);
        if (ser == null) { // can this ever occur?
            visitor.expectAnyFormat(typeHint);
            return;
        }
    }
    ser.acceptJsonFormatVisitor(visitor, type);
}
 
Example 4
Source File: SerializableSerializer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    visitor.expectAnyFormat(typeHint);
}
 
Example 5
Source File: UnknownSerializer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{ 
    visitor.expectAnyFormat(typeHint);
}
 
Example 6
Source File: DOMSerializer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException {
    if (visitor != null) visitor.expectAnyFormat(typeHint);
}