@SuppressWarnings({"unchecked"}) private DataType getDataType(Type type, TypeMapping typeMapping) { if (type instanceof Class) { // non-generic type Class<?> nonGenericType = (Class<?>) type; if (nonGenericType.isPrimitive()) { // convert primitive representation to its object equivalent nonGenericType = ParamTypes.PRIMITIVE_TO_OBJECT.get(nonGenericType); } return new JavaType(nonGenericType); } else { // a generic JavaTypeInfo info = helper.createTypeInfo(type, typeMapping); return new JavaGenericType(info); } }
@SuppressWarnings({"unchecked"}) private DataType<?> getDataType(Type type, TypeMapping typeMapping) { if (type instanceof Class) { // non-generic type Class<?> nonGenericType = (Class<?>) type; if (nonGenericType.isPrimitive()) { // convert primitive representation to its object equivalent nonGenericType = ParamTypes.PRIMITIVE_TO_OBJECT.get(nonGenericType); } return new JavaClass(nonGenericType); } else { // a generic JavaTypeInfo info = helper.createTypeInfo(type, typeMapping); return new JavaGenericType(info); } }
@SuppressWarnings({"unchecked"}) private DataType getDataType(Type type, TypeMapping typeMapping) { if (type instanceof Class) { // non-generic type Class<?> nonGenericType = (Class<?>) type; if (nonGenericType.isPrimitive()) { // convert primitive representation to its object equivalent nonGenericType = ParamTypes.PRIMITIVE_TO_OBJECT.get(nonGenericType); } return new JavaType(nonGenericType); } else { // a generic JavaTypeInfo info = helper.createTypeInfo(type, typeMapping); return new JavaGenericType(info); } }
@SuppressWarnings({"unchecked"}) private DataType<?> createDataType(Class<?> physicalType, Type type, TypeMapping mapping) { if (type instanceof Class) { // not a generic return new JavaClass(physicalType); } else { JavaTypeInfo info = helper.createTypeInfo(type, mapping); return new JavaGenericType(info); } }
/** * Returns a data type from a logical and physical type pairing. * * @param physicalType the physical type * @param type the type to construct the data type from * @param mapping the resolved generic type mappings * @return the data type */ @SuppressWarnings({"unchecked"}) private DataType<?> createDataType(Class<?> physicalType, Type type, TypeMapping mapping) { if (type instanceof Class) { // not a generic return new JavaClass(physicalType); } else { JavaTypeInfo info = helper.createTypeInfo(type, mapping); return new JavaGenericType(info); } }
/** * Returns a data type from a logical and physical type pairing. * * @param rawType the raw type * @param actualType the type to construct the data type from * @param mapping the resolved generic type mappings * @return the data type */ @SuppressWarnings({"unchecked"}) private DataType createDataType(Class<?> rawType, Type actualType, TypeMapping mapping) { if (actualType instanceof Class) { // not a generic return new JavaType(rawType); } else { JavaTypeInfo info = helper.createTypeInfo(actualType, mapping); return new JavaGenericType(info); } }
@SuppressWarnings({"unchecked"}) private DataType createDataType(Class<?> physicalType, Type type, TypeMapping mapping) { JavaType dataType; if (type instanceof Class) { // not a generic dataType = new JavaType(physicalType); } else { JavaTypeInfo info = helper.createTypeInfo(type, mapping); dataType = new JavaGenericType(info); } for (TypeIntrospector introspector : typeIntrospectors) { introspector.introspect(dataType); } return dataType; }