public static void write(final Request request, final ObjectAdapter adapter, final String fieldName,
final ObjectAdapter element, final String resultOverride, final String view, final String error,
final String title, final String cssClass) {
final ObjectAssociation field = adapter.getSpecification().getAssociation(fieldName);
if (field == null) {
throw new ScimpiException("No field " + fieldName + " in " + adapter.getSpecification().getFullIdentifier());
}
if (!field.isOneToManyAssociation()) {
throw new ScimpiException("Field " + fieldName + " not a collection, in "
+ adapter.getSpecification().getFullIdentifier());
}
if (field.isVisible(IsisContext.getAuthenticationSession(), adapter).isVetoed()) {
throw new ForbiddenException(field, ForbiddenException.VISIBLE);
}