Package com.android.utils
Class OffsetTrackingDecodedXmlValue
- java.lang.Object
-
- com.android.utils.OffsetTrackingDecodedXmlValue
-
public class OffsetTrackingDecodedXmlValue extends java.lang.ObjectDecodes 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.CharSequencegetDecodedCharacters()Returns the unescaped value.intgetEncodedOffset(int decodedOffset)Returns the offset in the original XML-encoded value given an offset in the decoded value.
-
-
-
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
-
-