public abstract class ParameterizedArgument extends CharacterSeparatedList
Example:
text/xml ; charset=toto text/xml; q=0.2 gzip; q=0.2
| Modifier and Type | Field and Description |
|---|---|
protected String |
argument
Current argument.
|
static char |
PARAMETER_SEP
Separator for the parameters: ';'.
|
static char |
TOKEN_SEP
Separator for the tokens: '='.
|
CR, currentString, HT, LF, separator, SP| Constructor and Description |
|---|
ParameterizedArgument()
Creates a new instance of
ParameterizedArgument with the default separator character of semicolon (";"). |
| Modifier and Type | Method and Description |
|---|---|
StringBuilder |
generate(StringBuilder sb)
Appends the current argument to the
StringBuffer sb. |
String |
getArgument()
Returns current argument.
|
protected abstract void |
initializeNbParameters(int nbParameters)
Initialize the number of parameters to read for this argument.
|
protected void |
initializeNbTokens(int nbTokens)
Initialize the number of tokens.
|
protected abstract void |
newParameter(int id,
int startKey,
int stopKey,
int startValue,
int stopValue)
Reads a new parameter.
|
protected void |
newToken(int id,
int start,
int stop)
Adds a new token to the array of tokens.
|
endParse, parse, parsepublic static final char PARAMETER_SEP
public static final char TOKEN_SEP
public ParameterizedArgument()
ParameterizedArgument with the default separator character of semicolon (";").public StringBuilder generate(StringBuilder sb)
StringBuffer sb.generate in class CharacterSeparatedListsb - the StringBuffer to append the argumentStringBuffer with the appended argument.@Nullable public String getArgument()
protected abstract void initializeNbParameters(int nbParameters)
nbParameters - the number of parametersprotected void initializeNbTokens(int nbTokens)
initializeNbTokens in class CharacterSeparatedListnbTokens - the number of tokens this instance can handle.protected abstract void newParameter(int id,
int startKey,
int stopKey,
int startValue,
int stopValue)
id - id for this parameterstartKey - the start index of searching the key substring in current argumentstopKey - the stop index of searching the key substring in current argumentstartValue - start index of searching the value substring in current argumentstopValue - stop index of searching the value substring in current argumentContentType.newParameter(int, int, int, int, int),
QualityArgument.newParameter(int, int, int, int, int)protected void newToken(int id,
int start,
int stop)
newToken in class CharacterSeparatedListid - the ID of the tokenstart - start index of parameter search in the current stringstop - end index of parameter search in the current string