|
PicketLink Federation Core 2.1.6.Final-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picketlink.identity.federation.core.parsers.util.StaxParserUtil
public class StaxParserUtil
Utility for the stax based parser
Field Summary | |
---|---|
protected static Validator |
validator
|
Constructor Summary | |
---|---|
StaxParserUtil()
|
Method Summary | |
---|---|
static void |
bypassElementBlock(XMLEventReader xmlEventReader,
String tag)
Bypass an entire XML element block from startElement to endElement |
static String |
getAttributeValue(Attribute attribute)
Given an Attribute , get its trimmed value |
static String |
getAttributeValue(StartElement startElement,
String tag)
Get the Attribute value |
static Element |
getDOMElement(XMLEventReader xmlEventReader)
Given that the XMLEventReader is in XMLStreamConstants.START_ELEMENT mode, we parse into a DOM Element |
static String |
getElementText(XMLEventReader xmlEventReader)
Get the element text. |
static String |
getEndElementName(EndElement endElement)
Return the name of the end element |
static String |
getLineColumnNumber(Location location)
Given a Location , return a formatted string [lineNum,colNum] |
static EndElement |
getNextEndElement(XMLEventReader xmlEventReader)
Get the next EndElement |
static XMLEvent |
getNextEvent(XMLEventReader xmlEventReader)
Get the next xml event |
static StartElement |
getNextStartElement(XMLEventReader xmlEventReader)
Get the next StartElement |
static Validator |
getSchemaValidator()
Get the Validator for JAXP Validation |
static String |
getStartElementName(StartElement startElement)
Return the name of the start element |
static XMLEventReader |
getXMLEventReader(InputStream is)
Get the XML event reader |
static String |
getXSITypeValue(StartElement startElement)
Given a start element, obtain the xsi:type defined |
static boolean |
hasTextAhead(XMLEventReader xmlEventReader)
Return whether the next event is going to be text |
static boolean |
matches(EndElement endElement,
String tag)
Match that the end element with the expected tag |
static boolean |
matches(StartElement startElement,
String tag)
Match that the start element with the expected tag |
static XMLEvent |
peek(XMLEventReader xmlEventReader)
Peek at the next event |
static EndElement |
peekNextEndElement(XMLEventReader xmlEventReader)
Peek the next EndElement |
static StartElement |
peekNextStartElement(XMLEventReader xmlEventReader)
Peek the next StartElement |
static String |
trim(String str)
Given a string, trim it |
static void |
validate(EndElement endElement,
String tag)
Validate that the end element has the expected tag |
static void |
validate(StartElement startElement,
String tag)
Validate that the start element has the expected tag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Validator validator
Constructor Detail |
---|
public StaxParserUtil()
Method Detail |
---|
public static void bypassElementBlock(XMLEventReader xmlEventReader, String tag) throws ParsingException
xmlEventReader
- tag
- Tag of the XML element that we need to bypass
ParsingException
public static String getAttributeValue(Attribute attribute)
Attribute
, get its trimmed value
attribute
-
public static String getAttributeValue(StartElement startElement, String tag)
startElement
- tag
- localpart of the qname of the attribute
public static Element getDOMElement(XMLEventReader xmlEventReader) throws ParsingException
XMLEventReader
is in XMLStreamConstants.START_ELEMENT
mode, we parse into a DOM Element
xmlEventReader
-
ParsingException
public static String getElementText(XMLEventReader xmlEventReader) throws ParsingException
xmlEventReader
-
ParsingException
public static XMLEventReader getXMLEventReader(InputStream is)
is
-
public static String getLineColumnNumber(Location location)
Location
, return a formatted string [lineNum,colNum]
location
-
public static XMLEvent getNextEvent(XMLEventReader xmlEventReader) throws ParsingException
xmlEventReader
-
ParsingException
public static StartElement getNextStartElement(XMLEventReader xmlEventReader) throws ParsingException
StartElement
xmlEventReader
-
ParsingException
public static EndElement getNextEndElement(XMLEventReader xmlEventReader) throws ParsingException
EndElement
xmlEventReader
-
ParsingException
public static String getStartElementName(StartElement startElement)
startElement
-
public static String getEndElementName(EndElement endElement)
endElement
-
public static String getXSITypeValue(StartElement startElement)
startElement
-
RuntimeException
- if xsi:type is missingpublic static boolean hasTextAhead(XMLEventReader xmlEventReader) throws ParsingException
xmlEventReader
-
ParsingException
public static boolean matches(StartElement startElement, String tag)
startElement
- tag
-
public static boolean matches(EndElement endElement, String tag)
endElement
- tag
-
public static XMLEvent peek(XMLEventReader xmlEventReader) throws ParsingException
xmlEventReader
-
ParsingException
public static StartElement peekNextStartElement(XMLEventReader xmlEventReader) throws ParsingException
StartElement
xmlEventReader
-
ParsingException
public static EndElement peekNextEndElement(XMLEventReader xmlEventReader) throws ParsingException
EndElement
xmlEventReader
-
ParsingException
public static final String trim(String str)
str
-
{@code
- IllegalArgumentException} if the passed str is nullpublic static void validate(StartElement startElement, String tag)
startElement
- tag
-
RuntimeException
- mismatchpublic static void validate(EndElement endElement, String tag)
endElement
- tag
-
RuntimeException
- mismatchpublic static Validator getSchemaValidator() throws SAXException, IOException
Validator
for JAXP Validation
SAXException
IOException
|
PicketLink Federation Core 2.1.6.Final-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |