in asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/LosslessJSONPrinterFactoryProvider.java [68:151]
public IPrinterFactory getPrinterFactory(Object typeInfo) {
IAType type = (IAType) typeInfo;
if (type != null) {
switch (type.getTypeTag()) {
case TINYINT:
return AInt8PrinterFactory.INSTANCE;
case SMALLINT:
return AInt16PrinterFactory.INSTANCE;
case INTEGER:
return AInt32PrinterFactory.INSTANCE;
case BIGINT:
return AInt64PrinterFactory.INSTANCE;
case MISSING:
case NULL:
return ANullPrinterFactory.INSTANCE;
case BOOLEAN:
return ABooleanPrinterFactory.INSTANCE;
case FLOAT:
return AFloatPrinterFactory.INSTANCE;
case DOUBLE:
return ADoublePrinterFactory.INSTANCE;
case TIME:
return ATimePrinterFactory.INSTANCE;
case DATE:
return ADatePrinterFactory.INSTANCE;
case DATETIME:
return ADateTimePrinterFactory.INSTANCE;
case DURATION:
return ADurationPrinterFactory.INSTANCE;
case YEARMONTHDURATION:
return AYearMonthDurationPrinterFactory.INSTANCE;
case DAYTIMEDURATION:
return ADayTimeDurationPrinterFactory.INSTANCE;
case INTERVAL:
return AIntervalPrinterFactory.INSTANCE;
case POINT:
return APointPrinterFactory.INSTANCE;
case POINT3D:
return APoint3DPrinterFactory.INSTANCE;
case LINE:
return ALinePrinterFactory.INSTANCE;
case POLYGON:
return APolygonPrinterFactory.INSTANCE;
case CIRCLE:
return ACirclePrinterFactory.INSTANCE;
case RECTANGLE:
return ARectanglePrinterFactory.INSTANCE;
case STRING:
return AStringPrinterFactory.INSTANCE;
case BINARY:
return ABinaryHexPrinterFactory.INSTANCE;
case OBJECT:
return new ARecordPrinterFactory((ARecordType) type);
case ARRAY:
return new AOrderedlistPrinterFactory((AOrderedListType) type);
case MULTISET:
return new AUnorderedlistPrinterFactory((AUnorderedListType) type);
case UNION:
if (((AUnionType) type).isUnknownableType()) {
return new AOptionalFieldPrinterFactory((AUnionType) type);
} else {
return new AUnionPrinterFactory((AUnionType) type);
}
case UUID:
return AUUIDPrinterFactory.INSTANCE;
case SHORTWITHOUTTYPEINFO:
return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
case ANY:
case BITARRAY:
case ENUM:
case SPARSOBJECT:
case SYSTEM_NULL:
case TYPE:
case UINT16:
case UINT32:
case UINT64:
case UINT8:
// These types are not intended to be printed to the user.
break;
}
}
return AObjectPrinterFactory.INSTANCE;
}