Package org.simpleframework.http.parse
Class PathParser.Token
java.lang.Object
org.simpleframework.http.parse.PathParser.Token
- Enclosing class:
PathParser
This is used so that the
PathParser
can speed
up the parsing of the data. Rather than using a buffer like
a ParseBuffer
or worse a StringBuffer
this just keeps an index into the character array from the
start and end of the token. Also this enables a cache to be
kept so that a String
does not need to be made
again after the first time it is created.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
value
Provides a quick retrieval of the token value. -
off
public int offOffset within the buffer that the token starts. -
len
public int lenLength of the region that the token consumes.
-
-
Constructor Details
-
Token
private Token()
-
-
Method Details
-
clear
public void clear()If theToken
is to be reused this will clear all previous data. Clearing the buffer allows it to be reused if there is a new URI to be parsed. This ensures that a null is returned if the token length is zero. -
toString
This method will convert theToken
into it'sString
equivelant. This will firstly check to see if there is a value, for the string representation, if there is the value is returned, otherwise the region is converted into aString
and returned.
-