Class XMLStreamReaderComparator


  • public class XMLStreamReaderComparator
    extends Object
    Helper class that compares the events produced by two XMLStreamReader objects. Note that this class is not meant to be used to compare two XML documents (the error reporting would not be clear enough for that purpose), but to validate implementations of the XMLStreamReader interface. It uses a brute force approach: for each event, all methods (that don't modify the reader state) are called on both readers and the results (return values or exceptions thrown) of these invocations are compared to each other.
    • Method Detail

      • setCompareInternalSubset

        public void setCompareInternalSubset​(boolean compareInternalSubset)
      • setCompareEntityReplacementValue

        public void setCompareEntityReplacementValue​(boolean value)
        Specify whether the replacement value for entity references (as reported by XMLStreamReader.getText()) should be compared. The default value for this option is true.
        Parameters:
        value - true if the replacement value should be compared; false if replacement values for entity references are ignored
      • setCompareCharacterEncodingScheme

        public void setCompareCharacterEncodingScheme​(boolean value)
      • setCompareEncoding

        public void setCompareEncoding​(boolean value)
      • setSortAttributes

        public void setSortAttributes​(boolean sortAttributes)
      • setTreatSpaceAsCharacters

        public void setTreatSpaceAsCharacters​(boolean treatSpaceAsCharacters)