use of core.framework.api.web.service.QueryParam in project core-ng-project by neowu.
the class QueryParamBeanTypeValidator method visitField.
@Override
public void visitField(Field field, String parentPath) {
QueryParam queryParam = field.getDeclaredAnnotation(QueryParam.class);
if (queryParam == null)
throw Exceptions.error("field must have @QueryParam, field={}", Fields.path(field));
Property property = field.getDeclaredAnnotation(Property.class);
if (property != null)
throw Exceptions.error("field must not have @Property, field={}", Fields.path(field));
String name = queryParam.name();
boolean added = visitedQueryParams.add(queryParam.name());
if (!added) {
throw Exceptions.error("found duplicate query param, field={}, name={}", Fields.path(field), name);
}
Class<?> fieldClass = field.getType();
if (fieldClass.isEnum()) {
JSONTypeValidator.validateEnumClass(fieldClass);
}
}
Aggregations