/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { ContactPerson person = (ContactPerson) samlObject; if (person.getType() != null) { domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, person.getType().toString()); } marshallUnknownAttributes(person, domElement); } }
/** * Lookup the specified type of Contact in the RP metadata. * * @param contactType what type to look up. * @return the {@link ContactPerson} or null. */ @Nullable public ContactPerson getContactPerson(final ContactPersonTypeEnumeration contactType) { if (null == getRPEntityDescriptor()) { return null; } final List<ContactPerson> contacts = getRPEntityDescriptor().getContactPersons(); if (null == contacts || contacts.isEmpty()) { log.trace("No Contacts found at all"); return null; } for (final ContactPerson contact : contacts) { if (contactType == contact.getType()) { return contact; } } log.trace("No matching Contacts found at all"); return null; }