@Override public Object findSerializer(Annotated a) { JsonSerialize ann = a.getAnnotation(JsonSerialize.class); if (ann != null) { Class<? extends JsonSerializer<?>> serClass = ann.using(); if (serClass != JsonSerializer.None.class) { return serClass; } } /* 18-Oct-2010, tatu: [JACKSON-351] @JsonRawValue handled just here, for now; * if we need to get raw indicator from other sources need to add * separate accessor within {@link AnnotationIntrospector} interface. */ JsonRawValue annRaw = a.getAnnotation(JsonRawValue.class); if ((annRaw != null) && annRaw.value()) { // let's construct instance with nominal type: Class<?> cls = a.getRawType(); return new RawSerializer<Object>(cls); } return null; }
public Object findSerializer(Annotated paramAnnotated) { JsonSerialize localJsonSerialize = (JsonSerialize)paramAnnotated.getAnnotation(JsonSerialize.class); if (localJsonSerialize != null) { Class localClass = localJsonSerialize.using(); if (localClass != JsonSerializer.None.class) return localClass; } JsonRawValue localJsonRawValue = (JsonRawValue)paramAnnotated.getAnnotation(JsonRawValue.class); if ((localJsonRawValue != null) && (localJsonRawValue.value())) return new RawSerializer(paramAnnotated.getRawType()); return null; }