final ClassTypePair ctp = (ctps.size() == 1) ? ctps.get(0) : null; if (ctp == null || ctp.rawClass() == String.class) { return new ParamConverter<T>() { @Override final ParamConverter<?> converter = provider.getConverter(ctp.rawClass(), ctp.type(), annotations); if (converter != null) { return new ParamConverter<T>() {
/** * Create new type-class pair. * * @param rawClass raw class representing the type. * @param type type behind the class. * * @return new type-class pair. */ public static ClassTypePair of(Class<?> rawClass, Type type) { return new ClassTypePair(rawClass, type); } }
final ClassTypePair ct = resolveGenericType(concreteClass, declaringClass, (Class) pt.getRawType(), ptts[i]); if (ct.type() != ptts[i]) { ptts[i] = ct.type(); modified = true; return ClassTypePair.of((Class<?>) pt.getRawType(), rpt); final ClassTypePair ct = resolveGenericType(concreteClass, declaringClass, null, gat.getGenericComponentType()); if (gat.getGenericComponentType() != ct.type()) { try { final Class ac = ReflectionHelper.getArrayForComponentType(ct.rawClass()); return ClassTypePair.of(ac); } catch (final Exception e) { LOGGER.log(Level.FINEST, "", e); return ClassTypePair.of(rawResolvedType, genericResolvedType);
private Class getResolvedType(final Type t, final Class c, final Class dc) { if (t instanceof Class) { return (Class) t; } else if (t instanceof TypeVariable) { final ClassTypePair ct = ReflectionHelper.resolveTypeVariable(c, dc, (TypeVariable) t); if (ct != null) { return ct.rawClass(); } else { return null; } } else if (t instanceof ParameterizedType) { final ParameterizedType pt = (ParameterizedType) t; return (Class) pt.getRawType(); } else { return null; } } }
LocalizationMessages.ERROR_RESOLVING_GENERIC_TYPE_VALUE(p.genericInterface, p.concreteClass)); ras[i] = ctp.type();
Type t = subMap.get(tv); if (t instanceof Class) { return ClassTypePair.of((Class) t); } else if (t instanceof GenericArrayType) { final GenericArrayType gat = (GenericArrayType) t; c = (Class<?>) t; try { return ClassTypePair.of(getArrayForComponentType(c)); } catch (final Exception ignored) { return ClassTypePair.of(getArrayForComponentType(c), gat); } catch (final Exception e) { return null; pt = (ParameterizedType) t; if (pt.getRawType() instanceof Class) { return ClassTypePair.of((Class<?>) pt.getRawType(), pt); } else { return null;
private Class getResolvedType(final Type t, final Class c, final Class dc) { if (t instanceof Class) { return (Class) t; } else if (t instanceof TypeVariable) { final ClassTypePair ct = ReflectionHelper.resolveTypeVariable(c, dc, (TypeVariable) t); if (ct != null) { return ct.rawClass(); } else { return null; } } else if (t instanceof ParameterizedType) { final ParameterizedType pt = (ParameterizedType) t; return (Class) pt.getRawType(); } else { return null; } } }
LocalizationMessages.ERROR_RESOLVING_GENERIC_TYPE_VALUE(p.genericInterface, p.concreteClass)); ras[i] = ctp.type();
Type t = subMap.get(tv); if (t instanceof Class) { return ClassTypePair.of((Class) t); } else if (t instanceof GenericArrayType) { final GenericArrayType gat = (GenericArrayType) t; c = (Class<?>) t; try { return ClassTypePair.of(getArrayForComponentType(c)); } catch (final Exception ignored) { return ClassTypePair.of(getArrayForComponentType(c), gat); } catch (final Exception e) { return null; pt = (ParameterizedType) t; if (pt.getRawType() instanceof Class) { return ClassTypePair.of((Class<?>) pt.getRawType(), pt); } else { return null;
final ClassTypePair ctp = (ctps.size() == 1) ? ctps.get(0) : null; if (ctp == null || ctp.rawClass() == String.class) { return new ParamConverter<T>() { @Override final ParamConverter<?> converter = provider.getConverter(ctp.rawClass(), ctp.type(), annotations); if (converter != null) { return new ParamConverter<T>() {
final ClassTypePair ct = resolveGenericType(concreteClass, declaringClass, (Class) pt.getRawType(), ptts[i]); if (ct.type() != ptts[i]) { ptts[i] = ct.type(); modified = true; return ClassTypePair.of((Class<?>) pt.getRawType(), rpt); final ClassTypePair ct = resolveGenericType(concreteClass, declaringClass, null, gat.getGenericComponentType()); if (gat.getGenericComponentType() != ct.type()) { try { final Class ac = ReflectionHelper.getArrayForComponentType(ct.rawClass()); return ClassTypePair.of(ac); } catch (final Exception e) { LOGGER.log(Level.FINEST, "", e); return ClassTypePair.of(rawResolvedType, genericResolvedType);
final TypeVariable tv = (TypeVariable) a; final ClassTypePair ctp = resolveTypeVariable(p.concreteClass, p.declaringClass, tv); cas[i] = (ctp != null) ? ctp.rawClass() : (Class<?>) (tv.getBounds()[0]); } else if (a instanceof GenericArrayType) { final GenericArrayType gat = (GenericArrayType) a;
LocalizationMessages.ERROR_RESOLVING_GENERIC_TYPE_VALUE(p.genericInterface, p.concreteClass)); ras[i] = ctp.type();
/** * Create new type-class pair for a non-generic class. * * @param rawClass (raw) class representing the non-generic type. * * @return new non-generic type-class pair. */ public static ClassTypePair of(Class<?> rawClass) { return new ClassTypePair(rawClass, rawClass); }
.map(type1 -> ClassTypePair.of(erasure(type1), type1)) .collect(Collectors.toList());
this.definitionMethod.getReturnType(), this.definitionMethod.getGenericReturnType()); this.rawResponseType = handlingCtPair.rawClass(); final boolean handlerReturnTypeIsParameterized = handlingCtPair.type() instanceof ParameterizedType; final boolean definitionReturnTypeIsParameterized = definitionCtPair.type() instanceof ParameterizedType; this.responseType = (handlingCtPair.rawClass() == definitionCtPair.rawClass() && definitionReturnTypeIsParameterized && !handlerReturnTypeIsParameterized) ? definitionCtPair.type() : handlingCtPair.type(); if (routingResponseType == null) { this.routingResponseType = responseType;
final ClassTypePair ct = resolveGenericType(concreteClass, declaringClass, (Class) pt.getRawType(), ptts[i]); if (ct.type() != ptts[i]) { ptts[i] = ct.type(); modified = true; return ClassTypePair.of((Class<?>) pt.getRawType(), rpt); final ClassTypePair ct = resolveGenericType(concreteClass, declaringClass, null, gat.getGenericComponentType()); if (gat.getGenericComponentType() != ct.type()) { try { final Class ac = ReflectionHelper.getArrayForComponentType(ct.rawClass()); return ClassTypePair.of(ac); } catch (final Exception e) { LOGGER.log(Level.FINEST, "", e); return ClassTypePair.of(rawResolvedType, genericResolvedType);
final TypeVariable tv = (TypeVariable) a; final ClassTypePair ctp = resolveTypeVariable(p.concreteClass, p.declaringClass, tv); cas[i] = (ctp != null) ? ctp.rawClass() : (Class<?>) (tv.getBounds()[0]); } else if (a instanceof GenericArrayType) { final GenericArrayType gat = (GenericArrayType) a;
LocalizationMessages.ERROR_RESOLVING_GENERIC_TYPE_VALUE(p.genericInterface, p.concreteClass)); ras[i] = ctp.type();
/** * Create new type-class pair for a non-generic class. * * @param rawClass (raw) class representing the non-generic type. * * @return new non-generic type-class pair. */ public static ClassTypePair of(Class<?> rawClass) { return new ClassTypePair(rawClass, rawClass); }