Gets the actual value class which the given type enum represents.<p>

@param type the type enum
@return the actual value class to use
356901
public static Class<?> getColumnClass(CmsDataViewColumn.Type type) {

        if (type == Type.imageType) {
            return Component.class;
        } else {
            return type.getValueClass();
        }
    }
591540
@Pure
	@SuppressWarnings("unchecked")
	public Class<? extends T> getValueType() {
		if (this.object == null) {
			return null;
		}
		return (Class<? extends T>) this.object.getClass();
	}
812439
public String getJniType(TypeMirror type) {
    if (TypeUtil.isPrimitiveOrVoid(type)) {
      return getPrimitiveObjCType(type);
    } else if (TypeUtil.isArray(type)) {
      return "jarray";
    } else if (typeUtil.isString(type)) {
      return "jstring";
    } else if (typeUtil.isClassType(type)) {
      return "jclass";
    }
    return "jobject";
  }
459654
public static boolean isRawType(final Type type) {
        if (type instanceof Class) {
            final Class<?> clazz = (Class<?>) type;
            return (clazz.getTypeParameters().length > 0);
        }
        if (type instanceof ParameterizedType) {
            final ParameterizedType ptype = (ParameterizedType) type;
            return (ptype.getActualTypeArguments().length == 0);
        }
        return false;
    }
893066
@SuppressWarnings( "unchecked" )
    public static <T> Class<T> returnedClass(Class<?> type)
    {
        ParameterizedType parameterizedType = (ParameterizedType) type.getGenericSuperclass();
        return (Class<T>) parameterizedType.getActualTypeArguments()[0];
    }
177970
public static Class<?> getClassFromType(final Type type) {
        Class<?> returnClass = null;
        if (type instanceof Class<?>) {
            returnClass = (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            returnClass = getClassFromType(((ParameterizedType) type).getRawType());
        }
        return returnClass;
    }
702750
protected static Type getTypeReference(Object type) {
        if (type instanceof Type) {
            return (Type) type;
        } else if (type instanceof Class) {
            return Type.getType((Class) type);
        } else if (type instanceof String) {
            String className = type.toString();

            String internalName = getInternalName(className);
            if (className.endsWith("[]")) {
                internalName = "[L" + internalName + ";";
            }
            return Type.getObjectType(internalName);
        } else {
            throw new IllegalArgumentException("Type reference [" + type + "] should be a Class or a String representing the class name");
        }
    }
1276898
public static Class getTypeClass(Type type)
    {
        Class typeClassClass = null;

        if (type instanceof Class) {
            typeClassClass = (Class) type;
        } else if (type instanceof ParameterizedType) {
            typeClassClass = (Class) ((ParameterizedType) type).getRawType();
        } else if (type instanceof GenericArrayType) {
            Class<?> arrrayParameter = getTypeClass(((GenericArrayType) type).getGenericComponentType());
            if (arrrayParameter != null) {
                typeClassClass = Array.newInstance(arrrayParameter, 0).getClass();
            }
        }

        return typeClassClass;
    }
339031
public static Class<?> rawClassOf(Type type) {
        if (type instanceof Class<?>) {
            return (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            Type rawType = parameterizedType.getRawType();
            return (Class<?>) rawType;
        } else if (type instanceof GenericArrayType) {
            Type componentType = ((GenericArrayType) type).getGenericComponentType();
            return Array.newInstance(rawClassOf(componentType), 0).getClass();
        } else if (type instanceof TypeVariable) {
            return Object.class;
        } else {
            throw new IllegalArgumentException("Unsupported type " + type.getTypeName());
        }
    }
1059929
public static Class<?> getRawType(Type type) {
		if (type instanceof Class) {
			return (Class<?>) type;
		} else if (type instanceof ParameterizedType) {
			ParameterizedType actualType = (ParameterizedType) type;
			return getRawType(actualType.getRawType());
		} else if (type instanceof GenericArrayType) {
			GenericArrayType genericArrayType = (GenericArrayType) type;
			Object rawArrayType = Array.newInstance(getRawType(genericArrayType
					.getGenericComponentType()), 0);
			return rawArrayType.getClass();
		} else if (type instanceof WildcardType) {
			WildcardType castedType = (WildcardType) type;
			return getRawType(castedType.getUpperBounds()[0]);
		} else {
			throw new IllegalArgumentException(
					"Type \'"
							+ type
							+ "\' is not a Class, "
							+ "ParameterizedType, or GenericArrayType. Can't extract class.");
		}
	}
1057003
public ValueReader enumReader(Class<?> enumType) {
        Object[] enums = enumType.getEnumConstants();
        Map<String,Object> byName = new HashMap<String,Object>();
        for (Object e : enums) {
            byName.put(e.toString(), e);
        }
        return new EnumReader(enums, byName);
    }
221462
public static Class getPrimitiveType(Class type) {
        if (type == int.class || type == Integer.class) {
            return int.class;
        } else if (type == long.class || type == Long.class) {
            return long.class;
        } else if (type == short.class || type == Short.class) {
            return short.class;
        } else if (type == double.class || type == Double.class) {
            return double.class;
        } else if (type == float.class || type == Float.class) {
            return float.class;
        } else if (type == char.class || type == Character.class) {
            return char.class;
        } else if (type == byte.class || type == Byte.class) {
            return byte.class;
        } else if (type == boolean.class || type == Boolean.class) {
            return boolean.class;
        }
        throw new IllegalArgumentException("Type '" + type + "' can not be converted to primitive type.");
    }
933675
@SuppressWarnings("unckecked")
    public static Class<?> getRawType(Type type) {
        if (type instanceof Class<?>) {
            // type is a normal class.
            return (Class<?>) type;

        } else if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;

            // I'm not exactly sure why getRawType() returns Type instead of Class.
            // Neal isn't either but suspects some pathological case related
            // to nested classes exists.
            Type rawType = parameterizedType.getRawType();
            checkArgument(rawType instanceof Class,
                    "Expected a Class, but <%s> is of type %s", type, type.getClass().getName());
            //noinspection ConstantConditions
            return (Class<?>) rawType;

        } else if (type instanceof GenericArrayType) {
            Type componentType = ((GenericArrayType) type).getGenericComponentType();
            return Array.newInstance(getRawType(componentType), 0).getClass();

        } else if (type instanceof TypeVariable) {
            // we could use the variable's bounds, but that'll won't work if there are multiple.
            // having a raw type that's more general than necessary is okay
            return Object.class;

        } else {
            throw new IllegalArgumentException("Expected a Class, ParameterizedType, or "
                    + "GenericArrayType, but <" + type + "> is of type " + type.getClass().getName());
        }
    }
1361533
private InputSource getCMLType(String type) {
        try {
            InputStream ins = this.getClass().getClassLoader()
                    .getResourceAsStream("org/openscience/cdk/io/cml/data/" + type);
            return new InputSource(new BufferedReader(new InputStreamReader(ins)));
        } catch (Exception e) {
            logger.error("Error while trying to read CML DTD (" + type + "): ", e.getMessage());
            logger.debug(e);
            return null;
        }
    }
731579
public static <X> BasicTypeInfo<X> getInfoFor(Class<X> type) {
		if (type == null) {
			throw new NullPointerException();
		}
		
		@SuppressWarnings("unchecked")
		BasicTypeInfo<X> info = (BasicTypeInfo<X>) TYPES.get(type);
		return info;
	}
1315340
public Type getType() {
        int varType = image.getInt(0) & 0xFFFF;
        return EnumDictionary.get(Type.class).constant(varType);
    }
621988
public static Object getPrimitiveDefaultValue(final Class<?> type) {
        
        Objects.requireNonNull(type, "type should not be null.");
        
        if(!type.isPrimitive()) {
            return null;
            
        } else if(boolean.class.isAssignableFrom(type)) {
            return false;
            
        } else if(char.class.isAssignableFrom(type)) {
            return '\u0000';
            
        } else if(byte.class.isAssignableFrom(type)) {
            return (byte)0;
            
        } else if(short.class.isAssignableFrom(type)) {
            return (short)0;
            
        } else if(int.class.isAssignableFrom(type)) {
            return 0;
            
        } else if(long.class.isAssignableFrom(type)) {
            return 0l;
            
        } else if(float.class.isAssignableFrom(type)) {
            return 0.0f;
            
        } else if(double.class.isAssignableFrom(type)) {
            return 0.0d;
        }
        
        return null;
        
    }