public PartialImpl(Map m,Type genericType) throws IllegalAccessException, InstantiationException { this.m = m; if(genericType != null){ clzz = (Class<T>)Types.getActualTypeArgument(genericType); }else{ clzz = null; } }
private Class<T> getModelClass() { return (Class<T>) Types.getActualTypeArgument(this.getClass().getGenericSuperclass()); }
public static Class<?> getElementType(Class<?> type, Type genericType) throws IllegalStateException { if(!isCollectionType(type, genericType)){ throw new IllegalStateException("The given type '" + type + "' is not a collection type"); } if(type.isArray()){ return type.getComponentType(); } if(null == genericType){ return Object.class; } return Types.getActualTypeArgument(genericType); }
public static Class<?> getActualTypeArgument(Class<?> declaringClass, Type genericType) { if(null == declaringClass) { return getActualTypeArgument(genericType); }else{ return getActualType(declaringClass, getTypeArgument(genericType)); } }
@Override public boolean convertFrom(Object value, Class<?> targetType, Type genericType, Out<Object> out, ConvertContext context) throws Throwable { Class<?> elementType = null == genericType ? Object.class : Types.getActualTypeArgument(genericType); if(value instanceof Iterable<?>){ out.set(toCollection(targetType, elementType, (Iterable<?>)value, context)); return true; }else if(value.getClass().isArray()){ out.set(toCollection(targetType, elementType, (Object[])value, context)); return true; }else if(value instanceof CharSequence){ out.set(toCollection(targetType, elementType, value.toString())); return true; } return false; }
if(List.class.isAssignableFrom(v.getType()) && Class.class.isAssignableFrom(Types.getActualTypeArgument(v.getGenericType()))){ java.lang.reflect.Type elementType = v.getGenericType(); if(elementType instanceof ParameterizedType){
Class<?> valueType = Types.getActualTypeArgument(v.getGenericType());
this.method = m; Class<?> eventType = Types.getActualTypeArgument(this.getClass().getGenericSuperclass()); boolean withEntity = EntityEventWithWrapper.class.isAssignableFrom(eventType);
beanType = Types.getActualTypeArgument(typeArgument); beanType = Types.getActualTypeArgument(genericType);
targetClass = leap.lang.Types.getActualTypeArgument(bp.getGenericType()); }else{ targetClass = bp.getType();