use of com.vaadin.flow.templatemodel.ModelType in project flow by vaadin.
the class AbstractTemplate method isSupportedClass.
/**
* Check if the given Class {@code type} is found in the Model.
*
* @param type
* Class to check support for
* @return True if supported by this PolymerTemplate
*/
public boolean isSupportedClass(Class<?> type) {
List<ModelType> modelTypes = ModelDescriptor.get(getModelType()).getPropertyNames().map(this::getModelType).collect(Collectors.toList());
boolean result = false;
for (ModelType modelType : modelTypes) {
if (type.equals(modelType.getJavaType())) {
result = true;
} else if (modelType instanceof ListModelType) {
result = checkListType(type, modelType);
}
if (result) {
break;
}
}
return result;
}
Aggregations