Class OffsetTrackingDecodedXmlValue


  • public class OffsetTrackingDecodedXmlValue
    extends java.lang.Object
    Decodes an XML string value keeping track of the original character offsets.
    • Constructor Summary

      Constructors 
      Constructor Description
      OffsetTrackingDecodedXmlValue​(java.lang.CharSequence encodedValue)
      Creates a decoded value for the given XML-encoded character sequence.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.CharSequence getDecodedCharacters()
      Returns the unescaped value.
      int getEncodedOffset​(int decodedOffset)
      Returns the offset in the original XML-encoded value given an offset in the decoded value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OffsetTrackingDecodedXmlValue

        public OffsetTrackingDecodedXmlValue​(@NonNull
                                             java.lang.CharSequence encodedValue)
        Creates a decoded value for the given XML-encoded character sequence.
    • Method Detail

      • getDecodedCharacters

        public java.lang.CharSequence getDecodedCharacters()
        Returns the unescaped value.
      • getEncodedOffset

        public int getEncodedOffset​(int decodedOffset)
        Returns the offset in the original XML-encoded value given an offset in the decoded value. Offset mapping function is extrapolated linearly beyond the bounds of the decoded value allowing the argument of the method to be outside of the decoded value bounds.
        Parameters:
        decodedOffset - the offset in the decoded value
        Returns:
        the offset in the original encoded value