public Consent disabled(final View view) {
final View[] subviews = view.getSubviews();
final StringBuffer missingFields = new StringBuffer();
final StringBuffer invalidFields = new StringBuffer();
for (final View field : subviews) {
final ParameterContent content = ((ParameterContent) field.getContent());
final boolean isEmpty = content.getAdapter() == null;
if (content.isRequired() && isEmpty) {
final String parameterName = content.getParameterName();
if (missingFields.length() > 0) {
missingFields.append(", ");
}
missingFields.append(parameterName);
} else if (field.getState().isInvalid()) {
final String parameterName = content.getParameterName();
if (invalidFields.length() > 0) {
invalidFields.append(", ");
}
invalidFields.append(parameterName);
}