Package org.owasp.esapi.codecs
Class PushbackString
- java.lang.Object
-
- org.owasp.esapi.codecs.PushbackString
-
public class PushbackString extends java.lang.ObjectThe 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 booleanhasNext()intindex()Get the current index of the PushbackString.static booleanisHexDigit(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 booleanisOctalDigit(java.lang.Character c)Returns true if the parameter character is an octal digit 0 through 7.voidmark()java.lang.Characternext()java.lang.CharacternextHex()java.lang.CharacternextOctal()java.lang.Characterpeek()Return the next character without affecting the current index.booleanpeek(char c)Test to see if the next character is a particular value without affecting the current index.voidpushback(java.lang.Character c)protected java.lang.Stringremainder()voidreset()
-
-
-
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:
-
-