Class PushbackString


  • public class PushbackString
    extends java.lang.Object
    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
      PushbackString​(java.lang.String input)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      int index()
      Get the current index of the PushbackString.
      static boolean isHexDigit​(java.lang.Character 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.Character c)
      Returns true if the parameter character is an octal digit 0 through 7.
      void mark()  
      java.lang.Character next()  
      java.lang.Character nextHex()  
      java.lang.Character nextOctal()  
      java.lang.Character peek()
      Return the next character without affecting the current index.
      boolean peek​(char c)
      Test to see if the next character is a particular value without affecting the current index.
      void pushback​(java.lang.Character c)  
      protected java.lang.String remainder()  
      void reset()  
      • Methods inherited from class java.lang.Object

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

      • PushbackString

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

      • pushback

        public void pushback​(java.lang.Character c)
        Parameters:
        c -
      • index

        public int index()
        Get the current index of the PushbackString. Typically used in error messages.
        Returns:
        The current index of the PushbackString.
      • hasNext

        public boolean hasNext()
        Returns:
      • next

        public java.lang.Character next()
        Returns:
      • nextHex

        public java.lang.Character nextHex()
        Returns:
      • nextOctal

        public java.lang.Character nextOctal()
        Returns:
      • isHexDigit

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

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

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

        public boolean peek​(char c)
        Test to see if the next character is a particular value without affecting the current index.
        Parameters:
        c -
        Returns:
      • mark

        public void mark()
      • reset

        public void reset()
      • remainder

        protected java.lang.String remainder()
        Returns: