Package org.keycloak.saml.common.parsers
Class AnyDomParser
- java.lang.Object
-
- org.keycloak.saml.common.parsers.AbstractStaxParser<List<Element>,AnyDomParser.Dom>
-
- org.keycloak.saml.common.parsers.AnyDomParser
-
- All Implemented Interfaces:
StaxParser
public class AnyDomParser extends AbstractStaxParser<List<Element>,AnyDomParser.Dom>
Parses any DOM tree to a list of DOM representations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnyDomParser.Dom
-
Field Summary
-
Fields inherited from class org.keycloak.saml.common.parsers.AbstractStaxParser
expectedStartElement, LOGGER
-
-
Constructor Summary
Constructors Constructor Description AnyDomParser(QName name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AnyDomParser.Dom
getElementFromName(QName name)
static AnyDomParser
getInstance(QName name)
protected List<Element>
instantiateElement(XMLEventReader xmlEventReader, StartElement element)
Instantiates the target Java class representing the current element.
Precondition: Current event is theStartElement
Postcondition: Current event is theStartElement
or theEndElement
corresponding to theStartElement
protected boolean
isUnknownElement(AnyDomParser.Dom token)
protected void
processSubElement(XMLEventReader xmlEventReader, List<Element> target, AnyDomParser.Dom element, StartElement elementDetail)
Processes the subelement of the element processed inAbstractStaxParser.instantiateElement(javax.xml.stream.XMLEventReader, javax.xml.stream.events.StartElement)
method.
Precondition: Current event: Last before theStartElement
corresponding to the processed subelement, i.e.-
Methods inherited from class org.keycloak.saml.common.parsers.AbstractStaxParser
parse, validateStartElement
-
-
-
-
Constructor Detail
-
AnyDomParser
public AnyDomParser(QName name)
-
-
Method Detail
-
getInstance
public static AnyDomParser getInstance(QName name)
-
instantiateElement
protected List<Element> instantiateElement(XMLEventReader xmlEventReader, StartElement element) throws ParsingException
Description copied from class:AbstractStaxParser
Instantiates the target Java class representing the current element.
Precondition: Current event is theStartElement
Postcondition: Current event is theStartElement
or theEndElement
corresponding to theStartElement
- Specified by:
instantiateElement
in classAbstractStaxParser<List<Element>,AnyDomParser.Dom>
element
- The XML event that was just read from thexmlEventReader
- Returns:
- Throws:
ParsingException
-
processSubElement
protected void processSubElement(XMLEventReader xmlEventReader, List<Element> target, AnyDomParser.Dom element, StartElement elementDetail) throws ParsingException
Description copied from class:AbstractStaxParser
Processes the subelement of the element processed inAbstractStaxParser.instantiateElement(javax.xml.stream.XMLEventReader, javax.xml.stream.events.StartElement)
method.
Precondition: Current event: Last before theStartElement
corresponding to the processed subelement, i.e. event obtained byIterator.next()
is theStartElement
of the subelement being processed
Postcondition: Event obtained byIterator.next()
is either the sameStartElement
(i.e. no change in position which causes this subelement to be skipped), the correspondingEndElement
, or the event after the correspondingEndElement
.Note that in case of recursive nesting the same element, the corresponding end element MUST be consumed in this method.
- Specified by:
processSubElement
in classAbstractStaxParser<List<Element>,AnyDomParser.Dom>
target
- Target object (the one created by theAbstractStaxParser.instantiateElement(javax.xml.stream.XMLEventReader, javax.xml.stream.events.StartElement)
method.element
- The constant corresponding to the current start element.elementDetail
- The XML event that was just read from thexmlEventReader
- Throws:
ParsingException
-
isUnknownElement
protected boolean isUnknownElement(AnyDomParser.Dom token)
- Overrides:
isUnknownElement
in classAbstractStaxParser<List<Element>,AnyDomParser.Dom>
-
getElementFromName
protected AnyDomParser.Dom getElementFromName(QName name)
- Specified by:
getElementFromName
in classAbstractStaxParser<List<Element>,AnyDomParser.Dom>
-
-