@@ -0,0 +1,2431 @@
+package org.anarres.typeserializer.core;%0A%0Aimport java.lang.reflect.GenericArrayType;%0Aimport java.lang.reflect.ParameterizedType;%0Aimport java.lang.reflect.Type;%0Aimport java.lang.reflect.TypeVariable;%0Aimport java.lang.reflect.WildcardType;%0Aimport javax.annotation.Nonnull;%0Aimport org.anarres.typeserializer.core.impl.Utils;%0A%0A/**%0A *%0A * @author shevek%0A */%0Apublic class TypeVisitor%3CI, O, X extends Exception%3E %7B%0A%0A    public O visit(@Nonnull Type value, I input) throws X %7B%0A        Utils.assertNotNull(value, %22Type was null.%22);%0A        if (value instanceof ParameterizedType) %7B%0A            return visitParameterizedType((ParameterizedType) value, input);%0A        %7D else if (value instanceof GenericArrayType) %7B%0A            return visitGenericArrayType((GenericArrayType) value, input);%0A        %7D else if (value instanceof Class%3C?%3E) %7B%0A            return visitClass((Class%3C?%3E) value, input);%0A        %7D else if (value instanceof TypeVariable%3C?%3E) %7B%0A            return visitTypeVariable((TypeVariable%3C?%3E) value, input);%0A        %7D else if (value instanceof WildcardType) %7B%0A            return visitWildcardType((WildcardType) value, input);%0A        %7D else %7B%0A            throw new IllegalArgumentException(%22Unknown type %22 + value);%0A        %7D%0A    %7D%0A%0A    public O visitParameterizedType(@Nonnull ParameterizedType value, I input) throws X %7B%0A        for (Type type : value.getActualTypeArguments())%0A            visit(type, input);%0A        return visitDefault(value, input);%0A    %7D%0A%0A    public O visitGenericArrayType(@Nonnull GenericArrayType value, I input) throws X %7B%0A        visit(value.getGenericComponentType(), input);%0A        return visitDefault(value, input);%0A    %7D%0A%0A    public O visitClass(@Nonnull Class%3C?%3E value, I input) throws X %7B%0A        if (value.isArray())%0A            visit(value.getComponentType(), input);%0A        return visitDefault(value, input);%0A    %7D%0A%0A    public O visitTypeVariable(TypeVariable%3C?%3E value, I input) throws X %7B%0A        for (Type bound : value.getBounds())%0A            visit(bound, input);%0A        return visitDefault(value, input);%0A    %7D%0A%0A    public O visitWildcardType(WildcardType value, I input) throws X %7B%0A        for (Type bound : value.getLowerBounds())%0A            visit(bound, input);%0A        for (Type bound : value.getUpperBounds())%0A            visit(bound, input);%0A        return visitDefault(value, input);%0A    %7D%0A%0A    public O visitDefault(Type type, I input) throws X %7B%0A        return null;%0A    %7D%0A%7D%0A

Add generic TypeVisitor.