Class PushBackSequenceImpl

  • All Implemented Interfaces:
    PushbackSequence<java.lang.Integer>

    public class PushBackSequenceImpl
    extends AbstractPushbackSequence<java.lang.Integer>
    The pushback string is used by Codecs to allow them to push decoded characters back onto a string for further decoding. This is necessary to detect double-encoding.
    Since:
    June 1, 2007
    Author:
    Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
    See Also:
    Encoder
    • Constructor Summary

      Constructors 
      Constructor Description
      PushBackSequenceImpl​(java.lang.String input)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isHexDigit​(java.lang.Integer c)
      Returns true if the parameter character is a hexidecimal digit 0 through 9, a through f, or A through F.
      static boolean isOctalDigit​(java.lang.Integer c)
      Returns true if the parameter character is an octal digit 0 through 7.
      void mark()
      Mark the location of the current index.
      java.lang.Integer next()
      Return the next element in the Sequence and increment the current index.
      java.lang.Integer nextHex()
      Return the next element in the Sequence in Hex format and increment the current index.
      java.lang.Integer nextOctal()
      Return the next element in the Sequence in Octal format and increment the current index.
      java.lang.Integer peek()
      Return the next codePoint without affecting the current index.
      boolean peek​(java.lang.Integer c)
      Test to see if the next codePoint is a particular value without affecting the current index.
      java.lang.String remainder()
      Not at all sure what this method is intended to do.
      void reset()
      Set the index back to the last marked location.
      • Methods inherited from class java.lang.Object

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

      • PushBackSequenceImpl

        public PushBackSequenceImpl​(java.lang.String input)
        Parameters:
        input -
    • Method Detail

      • next

        public java.lang.Integer next()
        Description copied from interface: PushbackSequence
        Return the next element in the Sequence and increment the current index.
        Returns:
        The next value in this Sequence, as an Integer.
      • nextHex

        public java.lang.Integer nextHex()
        Description copied from interface: PushbackSequence
        Return the next element in the Sequence in Hex format and increment the current index.
        Returns:
        The next value in this Sequence, as an Integer if it is a hex digit. Null otherwise.
      • nextOctal

        public java.lang.Integer nextOctal()
        Description copied from interface: PushbackSequence
        Return the next element in the Sequence in Octal format and increment the current index.
        Returns:
        The next value in this Sequence, as an Integer if it is an octal digit. Null otherwise.
      • isHexDigit

        public static boolean isHexDigit​(java.lang.Integer c)
        Returns true if the parameter character is a hexidecimal digit 0 through 9, a through f, or A through F.
        Parameters:
        c -
        Returns:
        true if it is a hexidecimal digit, false otherwise.
      • isOctalDigit

        public static boolean isOctalDigit​(java.lang.Integer c)
        Returns true if the parameter character is an octal digit 0 through 7.
        Parameters:
        c -
        Returns:
        true if it is an octal digit, false otherwise.
      • peek

        public java.lang.Integer peek()
        Return the next codePoint without affecting the current index.
        Returns:
        the next codePoint
      • peek

        public boolean peek​(java.lang.Integer c)
        Test to see if the next codePoint is a particular value without affecting the current index.
        Parameters:
        c -
        Returns:
        if the next value is equal to the supplied value.
      • mark

        public void mark()
        Mark the location of the current index.
      • reset

        public void reset()
        Set the index back to the last marked location.
      • remainder

        public java.lang.String remainder()
        Not at all sure what this method is intended to do. There is a line in HTMLEntityCodec that said calling this method is a "kludge around PushbackString..."
        Returns:
        Return the remaining portion of the sequence, with any pushback appended to the front (if any).