@Override
        public Type visitDeclared(DeclaredType declaredType, Boolean p) {
            if (declaredType.asElement() instanceof TypeElement) {
                TypeElement typeElement = (TypeElement) declaredType.asElement();
                switch (typeElement.getKind()) {
                    case ENUM:      return createEnumType(declaredType, typeElement, p);
                    case ANNOTATION_TYPE:
                    case CLASS:     return createClassType(declaredType, typeElement, p);
                    case INTERFACE: return createInterfaceType(declaredType, typeElement, p);
                    default: {
                        if (typeElement.getKind().name().equals("RECORD")) {
                            return createClassType(declaredType, typeElement, p);
                        }

                        throw new IllegalArgumentException("Illegal type " + typeElement);
                    }
                }
            } else {
                throw new IllegalArgumentException("Unsupported element type " + declaredType.asElement());
            }
        }
{@code ExtendedTypeFactory} is a factory for APT-based inspection {@link Type} creation

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