current.setKeyType( convertToClass(ptype.getActualTypeArguments()[0]) );
current.setKeyType( convertToClass(ptype.getActualTypeArguments()[0], current) );
    void fillInTypeInformation() {        Type type = this.bean.getClass();        for (NodeEvaluation current = this.root; current != null; current = current.getNext()) {            // If it's an array, return the component type            if (type instanceof GenericArrayType) {                type = ((GenericArrayType) type).getGenericComponentType();                current.setValueType(type);                current.setKeyType(Integer.class);                current.setType(NodeType.ArrayEntry);                continue;            }            else if (type instanceof Class && ((Class) type).isArray()) {                type = ((Class) type).getComponentType();                current.setValueType(type);                current.setKeyType(Integer.class);                current.setType(NodeType.ArrayEntry);                continue;            }            // Else if it's parameterized and it's a List or Map, get the next type            if (type instanceof ParameterizedType) {                ParameterizedType ptype = (ParameterizedType) type;                // TODO: convert to using convertToClass() here                Type rawType = ptype.getRawType();                if (rawType instanceof Class) {                    Class rawClass = (Class) rawType;                    if (List.class.isAssignableFrom(rawClass)) {                        type = ptype.getActualTypeArguments()[0];                        current.setValueType(type);                        current.setKeyType(Integer.class);                        current.setType(NodeType.ListEntry);                        continue;                    }                    else if (Map.class.isAssignableFrom(rawClass)) {                        type = ptype.getActualTypeArguments()[1];                        current.setValueType(type);                        current.setKeyType( convertToClass(ptype.getActualTypeArguments()[0]) );                        current.setType(NodeType.MapEntry);                        continue;                    }                    else {                        // Since it could be user defined type with a type parameter we'll                        // reassign the current type to be the raw type and let processing                        // fall through to the bean property code                        type = rawClass;                    }                }                else {                    // Raw type is not a class?  What on earth do we do now?                    break;                }            }            // Else if it's just a regular class we can try looking for a property on it. If            // no property exists, just bail out and return null immediately            if (type instanceof Class) {                Class clazz = (Class) type;                String property = current.getNode().getStringValue();                PropertyDescriptor pd = ReflectUtil.getPropertyDescriptor(clazz, property);                if (pd != null) {                    if (pd.getReadMethod() != null) {                        type = pd.getReadMethod().getGenericReturnType();                    }                    else {                        type = pd.getWriteMethod().getGenericParameterTypes()[0];                    }                    current.setValueType(type);                    current.setType(NodeType.BeanProperty);                }                else {                    Field field = ReflectUtil.getField(clazz, property);                    if (field == null) { break; }                    else  { type = field.getGenericType(); }                    current.setValueType(type);                    current.setType(NodeType.BeanProperty);                }            }        }        // Finally figure out what to store on the leaf node!        this.typeInformationValid = (this.leaf.getValueType() != null);    }