Package org.simpleframework.http.parse
Class PathParser.Token
- java.lang.Object
-
- org.simpleframework.http.parse.PathParser.Token
-
- Enclosing class:
- PathParser
private class PathParser.Token extends java.lang.Object
This is used so that thePathParser
can speed up the parsing of the data. Rather than using a buffer like aParseBuffer
or worse aStringBuffer
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 aString
does not need to be made again after the first time it is created.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Token()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
If theToken
is to be reused this will clear all previous data.java.lang.String
toString()
This method will convert theToken
into it'sString
equivelant.
-
-
-
Method Detail
-
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
public java.lang.String 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.- Overrides:
toString
in classjava.lang.Object
- Returns:
- this returns a value representing the token
-
-