* @see {@link ParserNamespaceSupport#parse(XMLEventReader)}
*/
public Object parse(XMLEventReader xmlEventReader) throws ParsingException {
StaxParserUtil.getNextEvent(xmlEventReader);
RequestSecurityTokenCollection requestCollection = new RequestSecurityTokenCollection();
// Peek at the next event
while (xmlEventReader.hasNext()) {
StartElement peekedElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
if (peekedElement == null)
break;
String tag = StaxParserUtil.getStartElementName(peekedElement);
if (WSTrustConstants.RST.equalsIgnoreCase(tag)) {
WSTRequestSecurityTokenParser rstParser = new WSTRequestSecurityTokenParser();
RequestSecurityToken rst = (RequestSecurityToken) rstParser.parse(xmlEventReader);
requestCollection.addRequestSecurityToken(rst);
}
}
return requestCollection;
}