/** * Validates the given party. * * @param object the object to validate, or {@code null}. * * @since 3.1 */ public void validate(final Party object) { if (object == null) { return; } boolean isMandatory = true; if (object instanceof Individual) { isMandatory &= isNullOrEmpty(((Individual) object).getPositionName()); } if (object instanceof Organisation) { isMandatory &= isNullOrEmpty(((Organisation) object).getLogo()); } if (isMandatory) { mandatory("Party: shall have a name.", object.getName()); } for (final Contact e : toArray(Contact.class, object.getContactInfo())) { validate(e); } }
if (party == null) continue; // Paranoiac safety. if (title == null) { title = toString(party.getName()); for (final Contact contact : party.getContactInfo()) { if (contact == null) continue; // Paranoiac safety. for (final OnlineResource resource : contact.getOnlineResources()) {