I guess the most robust way of doing this is to explicitly pass Class
objects in the constructor


On Tue, Oct 1, 2013 at 6:12 PM, Gary Russell <notifications@github.com>wrote:

> In
> spring-xd-dirt/src/main/java/org/springframework/integration/x/bus/converter/ContentTypeAwareConverter.java:
>
> > +
> > +
> > +/**
> > + *
> > + * @author David Turanski
> > + */
> > +// TODO: Revisit MessageConverters
> > +public abstract class ContentTypeAwareConverter<S, T> implements Converter<S, T> {
> > +
> > +	private final Class<?> sourceClass;
> > +
> > +	private final Class<?> targetClass;
> > +
> > +	public ContentTypeAwareConverter() {
> > +		Type type = this.getClass().getGenericSuperclass();
> > +		ParameterizedType parameterizedType = (ParameterizedType) type;
>
> Need to catch ClassCastException (in case the subclass does not declare
> types).
>
> Also, this will only work for immediate subclasses, right?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/spring-projects/spring-xd/pull/321/files#r6691382>
> .
>