public class NameValueParameterParser extends AbstractParameterParser
locale
Constructor and Description |
---|
NameValueParameterParser()
Default constructor.
|
NameValueParameterParser(Locale locale)
Constructs a new string parameter parser using the given locale.
|
Modifier and Type | Method and Description |
---|---|
String |
getTypeToken()
Returns the string which serves as a value type token for parameters of
this type.
|
Constraints |
parse(Properties db,
TokenTranslator tr,
ParserLoader parserLoader)
Creates an instance of
NameValueConstraints . |
Serializable |
parse(String token,
Constraints constraints,
Parameters soFar)
Returns a non-null object if the parsing of the given token was
succesful and if the object value complied with the specified
constraints, if any were specified.
|
getLocale
public NameValueParameterParser()
public NameValueParameterParser(Locale locale)
locale
- Locale to associate with this parser.public String getTypeToken()
TypedParser
TypedParser.getTypeToken()
public Constraints parse(Properties db, TokenTranslator tr, ParserLoader parserLoader)
NameValueConstraints
.db
- Set of properties that can be used to parametrize the
constraints implementation.tr
- A token translator that can be used for
locale-specific or other types of value translation.parserLoader
- Reference to the parameter and constraints parser loader.NameValueConstraints
instance created using the
specified properties.ConstraintsParser.parse(java.util.Properties, com.hp.util.format.TokenTranslator, com.hp.util.syntax.ParserLoader)
public Serializable parse(String token, Constraints constraints, Parameters soFar)
token
- String to be decoded/parsed into a Serializable entity.constraints
- Constraints & hints to use for parsing
and for validating the resulting Serializable.soFar
- Parameters accumulated by the parsing process thus far.NameValuePair
instance or null if the
resulting name value pair does not meet the constraints.ParameterParser.parse(java.lang.String, com.hp.util.syntax.parsers.Constraints, com.hp.util.syntax.Parameters)
Copyright © 2016. All Rights Reserved.