Class XMLStreamReaderUtil


  • public class XMLStreamReaderUtil
    extends Object

    XMLStreamReaderUtil provides some utility methods intended to be used in conjunction with a StAX XMLStreamReader.

    Author:
    WS Development Team
    • Method Detail

      • nextElementContent

        public static int nextElementContent​(XMLStreamReader reader)
      • nextWhiteSpaceContent

        public static String nextWhiteSpaceContent​(XMLStreamReader reader)
        Moves next and read spaces from the reader as long as to the next element. Comments are ignored
        Parameters:
        reader -
        Returns:
      • currentWhiteSpaceContent

        public static String currentWhiteSpaceContent​(XMLStreamReader reader)
        Read spaces from the reader as long as to the next element, starting from current position. Comments are ignored.
        Parameters:
        reader -
        Returns:
      • skipElement

        public static void skipElement​(XMLStreamReader reader)
        Skip current element, leaving the cursor at END_ELEMENT of current element.
      • skipSiblings

        public static void skipSiblings​(XMLStreamReader reader,
                                        QName parent)
        Skip following siblings, leaving cursor at END_ELEMENT of parent element.
      • getAttributes

        public static Attributes getAttributes​(XMLStreamReader reader)
        Read all attributes into an data structure. Note that this method cannot be called multiple times to get the same list of attributes.
      • verifyReaderState

        public static void verifyReaderState​(XMLStreamReader reader,
                                             int expectedState)
      • getStateName

        public static String getStateName​(int state)