}
JClassType customSerializer = customSerializers.get(type);
JClassType typeAsClass = type.isClass();
JEnumType enumType = type.isEnum();
JArrayType arrayType = type.isArray();
if (customSerializer != null) {
logger.log(Type.INFO, "Will serialize " + type + " using "
+ customSerializer.getName());
setSerializer(type, new CustomSerializer(customSerializer));
} else if (arrayType != null) {
logger.log(Type.INFO, "Will serialize " + type + " as an array");
setSerializer(type, new ArraySerializer(arrayType));
setNeedsSerialize(arrayType.getComponentType());
} else if (enumType != null) {
logger.log(Type.INFO, "Will serialize " + type + " as an enum");
setSerializer(type, new EnumSerializer(enumType));
} else if (typeAsClass != null) {
// Bean