Refine search
/** * Get the Attribute value * * @param startElement * @param tag localpart of the qname of the attribute * @return */ public static String getAttributeValue(StartElement startElement, String tag) { String result = null; Attribute attr = startElement.getAttributeByName(new QName(tag)); if (attr != null) result = getAttributeValue(attr); return result; }
/** * Get the Attribute value * * @param startElement * @param tag localpart of the qname of the attribute * * @return */ public static String getAttributeValue(StartElement startElement, String tag) { String result = null; Attribute attr = startElement.getAttributeByName(new QName(tag)); if (attr != null) result = getAttributeValue(attr); return result; }
/** * Get the Attribute value * * @param startElement * @param tag localpart of the qname of the attribute * * @return */ public static String getAttributeValue(StartElement startElement, String tag) { String result = null; Attribute attr = startElement.getAttributeByName(new QName(tag)); if (attr != null) result = getAttributeValue(attr); return result; }
private EndpointType getEndpointType(StartElement startElement) { Attribute bindingAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.BINDING.get())); String binding = StaxParserUtil.getAttributeValue(bindingAttr); Attribute locationAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.LOCATION.get())); String location = StaxParserUtil.getAttributeValue(locationAttr); EndpointType endpoint = new IndexedEndpointType(URI.create(binding), URI.create(location)); Attribute responseLocation = startElement.getAttributeByName(new QName(JBossSAMLConstants.RESPONSE_LOCATION.get())); if (responseLocation != null) { endpoint.setResponseLocation(URI.create(StaxParserUtil.getAttributeValue(responseLocation))); } return endpoint; }
protected void populateKeyValueType(KeyValueType kvt, StartElement startElement) { QName attributeQName = new QName("", KEY); Attribute attribute = startElement.getAttributeByName(attributeQName); if (attribute != null) kvt.setKey(StaxParserUtil.getAttributeValue(attribute)); attributeQName = new QName("", OPTION); attribute = startElement.getAttributeByName(attributeQName); if (attribute != null) kvt.setKey(StaxParserUtil.getAttributeValue(attribute)); attributeQName = new QName("", VALUE); attribute = startElement.getAttributeByName(attributeQName); if (attribute != null) kvt.setValue(StaxParserUtil.getAttributeValue(attribute)); } }
private EndpointType getEndpointType(StartElement startElement) { Attribute bindingAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.BINDING.get())); String binding = StaxParserUtil.getAttributeValue(bindingAttr); Attribute locationAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.LOCATION.get())); String location = StaxParserUtil.getAttributeValue(locationAttr); EndpointType endpoint = new IndexedEndpointType(URI.create(binding), URI.create(location)); Attribute responseLocation = startElement.getAttributeByName(new QName(JBossSAMLConstants.RESPONSE_LOCATION.get())); if (responseLocation != null) { endpoint.setResponseLocation(URI.create(StaxParserUtil.getAttributeValue(responseLocation))); } return endpoint; }
protected void populateKeyValueType(KeyValueType kvt, StartElement startElement) { QName attributeQName = new QName("", KEY); Attribute attribute = startElement.getAttributeByName(attributeQName); if (attribute != null) kvt.setKey(StaxParserUtil.getAttributeValue(attribute)); attributeQName = new QName("", OPTION); attribute = startElement.getAttributeByName(attributeQName); if (attribute != null) kvt.setKey(StaxParserUtil.getAttributeValue(attribute)); attributeQName = new QName("", VALUE); attribute = startElement.getAttributeByName(attributeQName); if (attribute != null) kvt.setValue(StaxParserUtil.getAttributeValue(attribute)); } }
protected SAML11RequestType parseRequiredAttributes(StartElement startElement) throws ParsingException { Attribute idAttr = startElement.getAttributeByName(new QName(SAML11Constants.REQUEST_ID)); if (idAttr == null) throw logger.parserRequiredAttribute(SAML11Constants.REQUEST_ID); String id = StaxParserUtil.getAttributeValue(idAttr); Attribute issueInstantAttr = startElement.getAttributeByName(new QName(SAML11Constants.ISSUE_INSTANT)); if (issueInstantAttr == null) throw logger.parserRequiredAttribute(SAML11Constants.ISSUE_INSTANT); XMLGregorianCalendar issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttr)); return new SAML11RequestType(id, issueInstant); }
protected SAML11RequestType parseRequiredAttributes(StartElement startElement) throws ParsingException { Attribute idAttr = startElement.getAttributeByName(new QName(SAML11Constants.REQUEST_ID)); if (idAttr == null) throw logger.parserRequiredAttribute(SAML11Constants.REQUEST_ID); String id = StaxParserUtil.getAttributeValue(idAttr); Attribute issueInstantAttr = startElement.getAttributeByName(new QName(SAML11Constants.ISSUE_INSTANT)); if (issueInstantAttr == null) throw logger.parserRequiredAttribute(SAML11Constants.ISSUE_INSTANT); XMLGregorianCalendar issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttr)); return new SAML11RequestType(id, issueInstant); }
private SAML11AssertionType parseBaseAttributes(StartElement nextElement) throws ParsingException { Attribute idAttribute = nextElement.getAttributeByName(new QName(SAML11Constants.ASSERTIONID)); if (idAttribute == null) throw logger.parserRequiredAttribute("AssertionID"); String id = StaxParserUtil.getAttributeValue(idAttribute); Attribute majVersionAttribute = nextElement.getAttributeByName(new QName(SAML11Constants.MAJOR_VERSION)); String majVersion = StaxParserUtil.getAttributeValue(majVersionAttribute); StringUtil.match("1", majVersion); Attribute minVersionAttribute = nextElement.getAttributeByName(new QName(SAML11Constants.MINOR_VERSION)); String minVersion = StaxParserUtil.getAttributeValue(minVersionAttribute); StringUtil.match("1", minVersion); Attribute issueInstantAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.ISSUE_INSTANT.get())); XMLGregorianCalendar issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttribute)); return new SAML11AssertionType(id, issueInstant); } }
private SAML11AssertionType parseBaseAttributes(StartElement nextElement) throws ParsingException { Attribute idAttribute = nextElement.getAttributeByName(new QName(SAML11Constants.ASSERTIONID)); if (idAttribute == null) throw logger.parserRequiredAttribute("AssertionID"); String id = StaxParserUtil.getAttributeValue(idAttribute); Attribute majVersionAttribute = nextElement.getAttributeByName(new QName(SAML11Constants.MAJOR_VERSION)); String majVersion = StaxParserUtil.getAttributeValue(majVersionAttribute); StringUtil.match("1", majVersion); Attribute minVersionAttribute = nextElement.getAttributeByName(new QName(SAML11Constants.MINOR_VERSION)); String minVersion = StaxParserUtil.getAttributeValue(minVersionAttribute); StringUtil.match("1", minVersion); Attribute issueInstantAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.ISSUE_INSTANT.get())); XMLGregorianCalendar issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttribute)); return new SAML11AssertionType(id, issueInstant); } }
private IndexedEndpointType parseIndexedEndpoint(XMLEventReader xmlEventReader, StartElement startElement) { Attribute bindingAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.BINDING.get())); String binding = StaxParserUtil.getAttributeValue(bindingAttr); Attribute locationAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.LOCATION.get())); String location = StaxParserUtil.getAttributeValue(locationAttr); IndexedEndpointType endpoint = new IndexedEndpointType(URI.create(binding), URI.create(location)); Attribute isDefault = startElement.getAttributeByName(new QName(JBossSAMLConstants.ISDEFAULT.get())); if (isDefault != null) { endpoint.setIsDefault(Boolean.parseBoolean(StaxParserUtil.getAttributeValue(isDefault))); } Attribute index = startElement.getAttributeByName(new QName(JBossSAMLConstants.INDEX.get())); if (index != null) { endpoint.setIndex(Integer.parseInt(StaxParserUtil.getAttributeValue(index))); } return endpoint; }
private IndexedEndpointType parseIndexedEndpoint(XMLEventReader xmlEventReader, StartElement startElement) { Attribute bindingAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.BINDING.get())); String binding = StaxParserUtil.getAttributeValue(bindingAttr); Attribute locationAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.LOCATION.get())); String location = StaxParserUtil.getAttributeValue(locationAttr); IndexedEndpointType endpoint = new IndexedEndpointType(URI.create(binding), URI.create(location)); Attribute isDefault = startElement.getAttributeByName(new QName(JBossSAMLConstants.ISDEFAULT.get())); if (isDefault != null) { endpoint.setIsDefault(Boolean.parseBoolean(StaxParserUtil.getAttributeValue(isDefault))); } Attribute index = startElement.getAttributeByName(new QName(JBossSAMLConstants.INDEX.get())); if (index != null) { endpoint.setIndex(Integer.parseInt(StaxParserUtil.getAttributeValue(index))); } return endpoint; }
private AssertionType parseBaseAttributes(StartElement nextElement) throws ParsingException { Attribute idAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.ID.get())); String id = StaxParserUtil.getAttributeValue(idAttribute); Attribute versionAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.VERSION.get())); String version = StaxParserUtil.getAttributeValue(versionAttribute); StringUtil.match(JBossSAMLConstants.VERSION_2_0.get(), version); Attribute issueInstantAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.ISSUE_INSTANT.get())); XMLGregorianCalendar issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttribute)); return new AssertionType(id, issueInstant); }
private AssertionType parseBaseAttributes(StartElement nextElement) throws ParsingException { Attribute idAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.ID.get())); String id = StaxParserUtil.getAttributeValue(idAttribute); Attribute versionAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.VERSION.get())); String version = StaxParserUtil.getAttributeValue(versionAttribute); StringUtil.match(JBossSAMLConstants.VERSION_2_0.get(), version); Attribute issueInstantAttribute = nextElement.getAttributeByName(new QName(JBossSAMLConstants.ISSUE_INSTANT.get())); XMLGregorianCalendar issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttribute)); return new AssertionType(id, issueInstant); }
/** * Parse a space delimited list of strings * * @param startElement * * @return */ public static List<String> parseProtocolEnumeration(StartElement startElement) { List<String> protocolEnum = new ArrayList<String>(); Attribute proto = startElement.getAttributeByName(new QName(JBossSAMLConstants.PROTOCOL_SUPPORT_ENUMERATION.get())); String val = StaxParserUtil.getAttributeValue(proto); if (StringUtil.isNotNull(val)) { StringTokenizer st = new StringTokenizer(val); while (st.hasMoreTokens()) { protocolEnum.add(st.nextToken()); } } return protocolEnum; } }
/** * Parse the attributes that are common to all SAML Request Types * * @param startElement * @param request * * @throws ParsingException */ protected void parseBaseAttributes(StartElement startElement, RequestAbstractType request) throws ParsingException { Attribute destinationAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.DESTINATION.get())); if (destinationAttr != null) request.setDestination(URI.create(StaxParserUtil.getAttributeValue(destinationAttr))); Attribute consent = startElement.getAttributeByName(new QName(JBossSAMLConstants.CONSENT.get())); if (consent != null) request.setConsent(StaxParserUtil.getAttributeValue(consent)); }
/** * Parse the attributes that are common to all SAML Request Types * * @param startElement * @param request * * @throws ParsingException */ protected void parseBaseAttributes(StartElement startElement, RequestAbstractType request) throws ParsingException { Attribute destinationAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.DESTINATION.get())); if (destinationAttr != null) request.setDestination(URI.create(StaxParserUtil.getAttributeValue(destinationAttr))); Attribute consent = startElement.getAttributeByName(new QName(JBossSAMLConstants.CONSENT.get())); if (consent != null) request.setConsent(StaxParserUtil.getAttributeValue(consent)); }
/** * Parse a space delimited list of strings * * @param startElement * * @return */ public static List<String> parseProtocolEnumeration(StartElement startElement) { List<String> protocolEnum = new ArrayList<String>(); Attribute proto = startElement.getAttributeByName(new QName(JBossSAMLConstants.PROTOCOL_SUPPORT_ENUMERATION.get())); String val = StaxParserUtil.getAttributeValue(proto); if (StringUtil.isNotNull(val)) { StringTokenizer st = new StringTokenizer(val); while (st.hasMoreTokens()) { protocolEnum.add(st.nextToken()); } } return protocolEnum; } }
protected void parseRequiredAttributes(StartElement startElement) throws ParsingException { Attribute idAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.ID.get())); if (idAttr == null) throw logger.parserRequiredAttribute("ID"); id = StaxParserUtil.getAttributeValue(idAttr); Attribute versionAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.VERSION.get())); if (versionAttr == null) throw logger.parserRequiredAttribute("Version"); version = StaxParserUtil.getAttributeValue(versionAttr); Attribute issueInstantAttr = startElement.getAttributeByName(new QName(JBossSAMLConstants.ISSUE_INSTANT.get())); if (issueInstantAttr == null) throw logger.parserRequiredAttribute("IssueInstant"); issueInstant = XMLTimeUtil.parse(StaxParserUtil.getAttributeValue(issueInstantAttr)); }