Module com.sun.xml.messaging.saaj
Class ParameterList
java.lang.Object
com.sun.xml.messaging.saaj.packaging.mime.internet.ParameterList
This class holds MIME parameters (attribute-value pairs).
- Version:
- 1.10, 03/02/12
-
Constructor Summary
ConstructorDescriptionNo-arg Constructor.Constructor that takes a parameter-list string. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns the value of the specified parameter.getNames()
Return an enumeration of the names of all parameters in this list.void
Removes the specified parameter from this ParameterList.void
Set a parameter.int
size()
Return the number of parameters in this list.toString()
Convert this ParameterList into a MIME String.toString
(int used) Convert this ParameterList into a MIME String.
-
Constructor Details
-
ParameterList
public ParameterList()No-arg Constructor. -
ParameterList
Constructor that takes a parameter-list string. The String is parsed and the parameters are collected and stored internally. A ParseException is thrown if the parse fails. Note that an empty parameter-list string is valid and will be parsed into an empty ParameterList.- Parameters:
s
- the parameter-list string.- Throws:
ParseException
- if the parse fails.
-
-
Method Details
-
size
public int size()Return the number of parameters in this list.- Returns:
- number of parameters.
-
get
Returns the value of the specified parameter. Note that parameter names are case-insensitive.- Parameters:
name
- parameter name.- Returns:
- Value of the parameter. Returns
null
if the parameter is not present.
-
set
Set a parameter. If this parameter already exists, it is replaced by this new value.- Parameters:
name
- name of the parameter.value
- value of the parameter.
-
remove
Removes the specified parameter from this ParameterList. This method does nothing if the parameter is not present.- Parameters:
name
- name of the parameter.
-
getNames
Return an enumeration of the names of all parameters in this list.- Returns:
- Enumeration of all parameter names in this list.
-
toString
Convert this ParameterList into a MIME String. If this is an empty list, an empty string is returned. -
toString
Convert this ParameterList into a MIME String. If this is an empty list, an empty string is returned. The 'used' parameter specifies the number of character positions already taken up in the field into which the resulting parameter list is to be inserted. It's used to determine where to fold the resulting parameter list.- Parameters:
used
- number of character positions already used, in the field into which the parameter list is to be inserted.- Returns:
- String
-
copy
-