use of org.keycloak.dom.saml.v2.mdui.LogoType in project keycloak by keycloak.
the class SAMLUIInfoParser method processSubElement.
@Override
protected void processSubElement(XMLEventReader xmlEventReader, UIInfoType target, SAMLMetadataQNames element, StartElement elementDetail) throws ParsingException {
switch(element) {
case DISPLAY_NAME:
LocalizedNameType displayName = new LocalizedNameType(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_LANG));
StaxParserUtil.advance(xmlEventReader);
displayName.setValue(StaxParserUtil.getElementText(xmlEventReader));
target.addDisplayName(displayName);
break;
case DESCRIPTION:
LocalizedNameType description = new LocalizedNameType(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_LANG));
StaxParserUtil.advance(xmlEventReader);
description.setValue(StaxParserUtil.getElementText(xmlEventReader));
target.addDescription(description);
break;
case KEYWORDS:
KeywordsType keywords = new KeywordsType(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_LANG));
target.addKeywords(keywords);
break;
case INFORMATION_URL:
LocalizedURIType informationURL = new LocalizedURIType(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_LANG));
StaxParserUtil.advance(xmlEventReader);
informationURL.setValue(URI.create(StaxParserUtil.getElementText(xmlEventReader)));
target.addInformationURL(informationURL);
break;
case PRIVACY_STATEMENT_URL:
LocalizedURIType privacyStatementURL = new LocalizedURIType(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_LANG));
StaxParserUtil.advance(xmlEventReader);
privacyStatementURL.setValue(URI.create(StaxParserUtil.getElementText(xmlEventReader)));
target.addPrivacyStatementURL(privacyStatementURL);
break;
case LOGO:
LogoType logo = new LogoType(Integer.parseInt(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_HEIGHT)), Integer.parseInt(StaxParserUtil.getRequiredAttributeValue(elementDetail, ATTR_WIDTH)));
String lang = StaxParserUtil.getAttributeValue(elementDetail, ATTR_LANG);
if (lang != null)
logo.setLang(lang);
StaxParserUtil.advance(xmlEventReader);
try {
String logoValue = StaxParserUtil.getElementText(xmlEventReader).replaceAll("\\s+", "");
logo.setValue(new URI(logoValue));
} catch (URISyntaxException ex) {
throw new ParsingException(ex);
}
target.addLogo(logo);
break;
default:
throw LOGGER.parserUnknownTag(StaxParserUtil.getElementName(elementDetail), elementDetail.getLocation());
}
}
Aggregations