static Class<?> getFieldType(Formatter<?> formatter) { Class<?> fieldType = GenericTypeResolver.resolveTypeArgument(formatter.getClass(), Formatter.class); if (fieldType == null && formatter instanceof DecoratingProxy) { fieldType = GenericTypeResolver.resolveTypeArgument( ((DecoratingProxy) formatter).getDecoratedClass(), Formatter.class); } if (fieldType == null) { throw new IllegalArgumentException("Unable to extract the parameterized field type from Formatter [" + formatter.getClass().getName() + "]; does the class parameterize the <T> generic type?"); } return fieldType; }
@Override public void addConverter(Converter<?, ?> converter) { ResolvableType[] typeInfo = getRequiredTypeInfo(converter.getClass(), Converter.class); if (typeInfo == null && converter instanceof DecoratingProxy) { typeInfo = getRequiredTypeInfo(((DecoratingProxy) converter).getDecoratedClass(), Converter.class); } if (typeInfo == null) { throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " + "Converter [" + converter.getClass().getName() + "]; does the class parameterize those types?"); } addConverter(new ConverterAdapter(converter, typeInfo[0], typeInfo[1])); }
static Class<?> getFieldType(Formatter<?> formatter) { Class<?> fieldType = GenericTypeResolver.resolveTypeArgument(formatter.getClass(), Formatter.class); if (fieldType == null && formatter instanceof DecoratingProxy) { fieldType = GenericTypeResolver.resolveTypeArgument( ((DecoratingProxy) formatter).getDecoratedClass(), Formatter.class); } if (fieldType == null) { throw new IllegalArgumentException("Unable to extract the parameterized field type from Formatter [" + formatter.getClass().getName() + "]; does the class parameterize the <T> generic type?"); } return fieldType; }
/** * This implementation retrieves an @{@link javax.annotation.Priority} * value, allowing for additional semantics over the regular @{@link Order} * annotation: typically, selecting one object over another in case of * multiple matches but only one object to be returned. */ @Override @Nullable public Integer getPriority(Object obj) { if (obj instanceof Class) { return OrderUtils.getPriority((Class<?>) obj); } Integer priority = OrderUtils.getPriority(obj.getClass()); if (priority == null && obj instanceof DecoratingProxy) { priority = OrderUtils.getPriority(((DecoratingProxy) obj).getDecoratedClass()); } return priority; }
@Override public void addConverter(Converter<?, ?> converter) { ResolvableType[] typeInfo = getRequiredTypeInfo(converter.getClass(), Converter.class); if (typeInfo == null && converter instanceof DecoratingProxy) { typeInfo = getRequiredTypeInfo(((DecoratingProxy) converter).getDecoratedClass(), Converter.class); } if (typeInfo == null) { throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " + "Converter [" + converter.getClass().getName() + "]; does the class parameterize those types?"); } addConverter(new ConverterAdapter(converter, typeInfo[0], typeInfo[1])); }
@Override public void addConverterFactory(ConverterFactory<?, ?> factory) { ResolvableType[] typeInfo = getRequiredTypeInfo(factory.getClass(), ConverterFactory.class); if (typeInfo == null && factory instanceof DecoratingProxy) { typeInfo = getRequiredTypeInfo(((DecoratingProxy) factory).getDecoratedClass(), ConverterFactory.class); } if (typeInfo == null) { throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " + "ConverterFactory [" + factory.getClass().getName() + "]; does the class parameterize those types?"); } addConverter(new ConverterFactoryAdapter(factory, new ConvertiblePair(typeInfo[0].toClass(), typeInfo[1].toClass()))); }
/** * This implementation retrieves an @{@link javax.annotation.Priority} * value, allowing for additional semantics over the regular @{@link Order} * annotation: typically, selecting one object over another in case of * multiple matches but only one object to be returned. */ @Override @Nullable public Integer getPriority(Object obj) { if (obj instanceof Class) { return OrderUtils.getPriority((Class<?>) obj); } Integer priority = OrderUtils.getPriority(obj.getClass()); if (priority == null && obj instanceof DecoratingProxy) { priority = OrderUtils.getPriority(((DecoratingProxy) obj).getDecoratedClass()); } return priority; }
@Override public void addConverterFactory(ConverterFactory<?, ?> factory) { ResolvableType[] typeInfo = getRequiredTypeInfo(factory.getClass(), ConverterFactory.class); if (typeInfo == null && factory instanceof DecoratingProxy) { typeInfo = getRequiredTypeInfo(((DecoratingProxy) factory).getDecoratedClass(), ConverterFactory.class); } if (typeInfo == null) { throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " + "ConverterFactory [" + factory.getClass().getName() + "]; does the class parameterize those types?"); } addConverter(new ConverterFactoryAdapter(factory, new ConvertiblePair(typeInfo[0].toClass(), typeInfo[1].toClass()))); }
order = OrderUtils.getOrder(obj.getClass()); if (order == null && obj instanceof DecoratingProxy) { order = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());
order = OrderUtils.getOrder(obj.getClass()); if (order == null && obj instanceof DecoratingProxy) { order = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());
static Class<?> getFieldType(Formatter<?> formatter) { Class<?> fieldType = GenericTypeResolver.resolveTypeArgument(formatter.getClass(), Formatter.class); if (fieldType == null && formatter instanceof DecoratingProxy) { fieldType = GenericTypeResolver.resolveTypeArgument( ((DecoratingProxy) formatter).getDecoratedClass(), Formatter.class); } if (fieldType == null) { throw new IllegalArgumentException("Unable to extract the parameterized field type from Formatter [" + formatter.getClass().getName() + "]; does the class parameterize the <T> generic type?"); } return fieldType; }
@Override public void addConverter(Converter<?, ?> converter) { ResolvableType[] typeInfo = getRequiredTypeInfo(converter.getClass(), Converter.class); if (typeInfo == null && converter instanceof DecoratingProxy) { typeInfo = getRequiredTypeInfo(((DecoratingProxy) converter).getDecoratedClass(), Converter.class); } if (typeInfo == null) { throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " + "Converter [" + converter.getClass().getName() + "]; does the class parameterize those types?"); } addConverter(new ConverterAdapter(converter, typeInfo[0], typeInfo[1])); }
/** * This implementation retrieves an @{@link javax.annotation.Priority} * value, allowing for additional semantics over the regular @{@link Order} * annotation: typically, selecting one object over another in case of * multiple matches but only one object to be returned. */ @Override @Nullable public Integer getPriority(Object obj) { if (obj instanceof Class) { return OrderUtils.getPriority((Class<?>) obj); } Integer priority = OrderUtils.getPriority(obj.getClass()); if (priority == null && obj instanceof DecoratingProxy) { priority = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass()); } return priority; }
/** * This implementation retrieves an @{@link javax.annotation.Priority} * value, allowing for additional semantics over the regular @{@link Order} * annotation: typically, selecting one object over another in case of * multiple matches but only one object to be returned. */ @Override @Nullable public Integer getPriority(Object obj) { if (obj instanceof Class) { return OrderUtils.getPriority((Class<?>) obj); } Integer priority = OrderUtils.getPriority(obj.getClass()); if (priority == null && obj instanceof DecoratingProxy) { priority = OrderUtils.getPriority(((DecoratingProxy) obj).getDecoratedClass()); } return priority; }
/** * This implementation retrieves an @{@link javax.annotation.Priority} * value, allowing for additional semantics over the regular @{@link Order} * annotation: typically, selecting one object over another in case of * multiple matches but only one object to be returned. */ @Override @Nullable public Integer getPriority(Object obj) { if (obj instanceof Class) { return OrderUtils.getPriority((Class<?>) obj); } Integer priority = OrderUtils.getPriority(obj.getClass()); if (priority == null && obj instanceof DecoratingProxy) { priority = OrderUtils.getPriority(((DecoratingProxy) obj).getDecoratedClass()); } return priority; }
@Override public void addConverterFactory(ConverterFactory<?, ?> factory) { ResolvableType[] typeInfo = getRequiredTypeInfo(factory.getClass(), ConverterFactory.class); if (typeInfo == null && factory instanceof DecoratingProxy) { typeInfo = getRequiredTypeInfo(((DecoratingProxy) factory).getDecoratedClass(), ConverterFactory.class); } if (typeInfo == null) { throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " + "ConverterFactory [" + factory.getClass().getName() + "]; does the class parameterize those types?"); } addConverter(new ConverterFactoryAdapter(factory, new ConvertiblePair(typeInfo[0].toClass(), typeInfo[1].toClass()))); }
order = findOrderInModule( obj.getClass() ); if ( order == null && obj instanceof DecoratingProxy ) { order = findOrderInModule( ( (DecoratingProxy) obj ).getDecoratedClass() );
order = OrderUtils.getOrder(obj.getClass()); if (order == null && obj instanceof DecoratingProxy) { order = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());
order = OrderUtils.getOrder(obj.getClass()); if (order == null && obj instanceof DecoratingProxy) { order = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());
order = OrderUtils.getOrder(obj.getClass()); if (order == null && obj instanceof DecoratingProxy) { order = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());