@Override
    public TypeElement visitDeclared(DeclaredType t, Void p) {
        if (t.asElement() instanceof TypeElement) {
            TypeElement typeElement = (TypeElement) t.asElement();
            switch (typeElement.getKind()) {
                case ENUM:      return skipEnum ? null : typeElement;
                case CLASS:     return typeElement;
                case INTERFACE: return visitInterface(t);
                default: throw new IllegalArgumentException("Illegal type: " + typeElement);
            }
        } else {
            return null;
        }
    }
{@code TypeExtractor} is a visitor implementation which extracts a concrete type from a generic {@link TypeElement}

@author tiwe
querydsl-apt/src/main/java/com/querydsl/apt/TypeExtractor.java