Interface XMLExtendedStreamReader

    • Method Detail

      • handleAny

        void handleAny​(Object value)
                throws XMLStreamException
        Handle an <xs:any>-type nested element, passing in the given value, returning after the end of the element. Must be positioned on a START_ELEMENT or an exception will occur. On return the cursor will be positioned on the corresponding END_ELEMENT.
        Parameters:
        value - the value to pass in
        Throws:
        XMLStreamException - if an error occurs (e.g. the given value does not match the type of the handler for the element, or the element is unknown)
      • handleAttribute

        void handleAttribute​(Object value,
                             int index)
                      throws XMLStreamException
        Handle an extended attribute, passing in the given value. Must be positioned on a START_ELEMENT or an exception will occur. On return the cursor will be pointing at the same START_ELEMENT.
        Parameters:
        value - the value to pass in
        index - the index of the attribute to process
        Throws:
        XMLStreamException - if an error occurs
      • discardRemainder

        void discardRemainder()
                       throws XMLStreamException
        Discard the remaining content of an element. Runs until a END_ELEMENT is encountered. If a START_ELEMENT is encountered, then recursively consume and ignore its content as well.
        Throws:
        XMLStreamException - if an error occurs.
      • getIntAttributeValue

        int getIntAttributeValue​(int index)
                          throws XMLStreamException
        Get the value of an attribute as an integer.
        Parameters:
        index - the index of the attribute
        Returns:
        the integer value
        Throws:
        XMLStreamException - if an error occurs
      • getIntListAttributeValue

        int[] getIntListAttributeValue​(int index)
                                throws XMLStreamException
        Get the value of an attribute as an integer list.
        Parameters:
        index - the index of the attribute
        Returns:
        the integer values
        Throws:
        XMLStreamException - if an error occurs
      • getListAttributeValue

        List<String> getListAttributeValue​(int index)
                                    throws XMLStreamException
        Get the value of an attribute as a space-delimited string list.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        XMLStreamException - if an error occurs
      • getLongAttributeValue

        long getLongAttributeValue​(int index)
                            throws XMLStreamException
        Get the value of an attribute as a long.
        Parameters:
        index - the index of the attribute
        Returns:
        the long value
        Throws:
        XMLStreamException - if an error occurs
      • getLongListAttributeValue

        long[] getLongListAttributeValue​(int index)
                                  throws XMLStreamException
        Get the value of an attribute as a long integer list.
        Parameters:
        index - the index of the attribute
        Returns:
        the long values
        Throws:
        XMLStreamException - if an error occurs
      • getAttributeValue

        <T> T getAttributeValue​(int index,
                                Class<T> kind)
                         throws XMLStreamException
        Get the attribute value using intelligent type conversion. Numeric types will be parsed; enum types will be mapped.
        Type Parameters:
        T - the type of the expected object
        Parameters:
        index - the index of the attribute
        kind - the class of the expected object
        Returns:
        the object equivalent
        Throws:
        XMLStreamException - if an error occurs
      • getListAttributeValue

        <T> List<? extends T> getListAttributeValue​(int index,
                                                    Class<T> kind)
                                             throws XMLStreamException
        Get the attribute value as a list using intelligent type conversion. Numeric types will be parsed; enum types will be mapped.
        Parameters:
        index - the index of the attribute
        kind - the class of the expected object
        Returns:
        the list of object equivalents
        Throws:
        XMLStreamException - if an error occurs
      • setTrimElementText

        void setTrimElementText​(boolean trim)
        Whether or not XMLStreamReader.getElementText() should trim content. The default is true.
        Parameters:
        trim - trim if true, don't if false