org.owasp.esapi.codecs
Class PushbackString

java.lang.Object
  extended by org.owasp.esapi.codecs.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
PushbackString(java.lang.String input)
           
 
Method Summary
 boolean hasNext()
           
 int index()
           
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()
Returns:

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:


Copyright © 2011 The Open Web Application Security Project (OWASP). All Rights Reserved.