Lists
, Sets
* etc) and {@link java.util.Map}s and iterable things
* ({@link java.util.Iterator}s).
*/
@SuppressWarnings("serial")
public abstract class ContainerSerializer* Note: although it might seem sensible to instead define something * like "getElementCount()" method, this would not work well for * containers that do not keep track of size (like linked lists may * not). *
* Note, too, that as of now (2.9) this method is only called by serializer
* itself; and specifically is not used for non-array/collection types
* like Map
or Map.Entry
instances.
*/
public abstract boolean hasSingleElement(T value);
/**
* Method that needs to be implemented to allow construction of a new
* serializer object with given {@link TypeSerializer}, used when
* addition type information is to be embedded.
*/
protected abstract ContainerSerializer> _withValueTypeSerializer(TypeSerializer vts);
/*
/**********************************************************
/* Helper methods for sub-types
/**********************************************************
*/
/**
* Helper method used to encapsulate logic for determining whether there is
* a property annotation that overrides element type; if so, we can
* and need to statically find the serializer.
*
* @since 2.1
*
* @deprecated Since 2.7: should not be needed; should be enough to see if
* type has 'isStatic' modifier
*/
@Deprecated
protected boolean hasContentTypeAnnotation(SerializerProvider provider,
BeanProperty property)
{
/*
if (property != null) {
AnnotationIntrospector intr = provider.getAnnotationIntrospector();
AnnotatedMember m = property.getMember();
if ((m != null) && (intr != null)) {
if (intr.findSerializationContentType(m, property.getType()) != null) {
return true;
}
}
}
*/
return false;
}
}