/** * Checks that one or more Service Names are present. * * @param attributeConsumingService * @throws ValidationException */ protected void validateServiceNames(AttributeConsumingService attributeConsumingService) throws ValidationException { if (attributeConsumingService.getNames() == null || attributeConsumingService.getNames().size() == 0) { throw new ValidationException("Must have one or more Service Names."); } }
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { AttributeConsumingService service = (AttributeConsumingService) parentSAMLObject; if (childSAMLObject instanceof ServiceName) { service.getNames().add((ServiceName) childSAMLObject); } else if (childSAMLObject instanceof ServiceDescription) { service.getDescriptions().add((ServiceDescription) childSAMLObject); } else if (childSAMLObject instanceof RequestedAttribute) { service.getRequestAttributes().add((RequestedAttribute) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }