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.ObjectThis is used so that thePathParsercan speed up the parsing of the data. Rather than using a buffer like aParseBufferor worse aStringBufferthis 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 aStringdoes not need to be made again after the first time it is created.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateToken()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()If theTokenis to be reused this will clear all previous data.java.lang.StringtoString()This method will convert theTokeninto it'sStringequivelant.
-
-
-
Method Detail
-
clear
public void clear()
If theTokenis 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 theTokeninto it'sStringequivelant. 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 aStringand returned.- Overrides:
toStringin classjava.lang.Object- Returns:
- this returns a value representing the token
-
-