private Property toProperty(EntityType entityType, String name, TypeMirror type,
            Annotations annotations) {
        // type
        Type propertyType = typeFactory.getType(type, true);
        if (annotations.isAnnotationPresent(QueryType.class)) {
            PropertyType propertyTypeAnn = annotations.getAnnotation(QueryType.class).value();
            if (propertyTypeAnn != PropertyType.NONE) {
                TypeCategory typeCategory = TypeCategory.valueOf(annotations.getAnnotation(QueryType.class).value().name());
                if (typeCategory == null) {
                    return null;
                }
                propertyType = propertyType.as(typeCategory);
            } else {
                return null;
            }
        }

        // inits
        List<String> inits = Collections.emptyList();
        if (annotations.isAnnotationPresent(QueryInit.class)) {
            inits = Arrays.asList(annotations.getAnnotation(QueryInit.class).value());
        }

        return new Property(entityType, name, propertyType, inits);
    }
{@code TypeElementHandler} is an APT visitor for entity types

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