Package javax.mail.internet
Class ParameterList
- java.lang.Object
-
- javax.mail.internet.ParameterList
-
public class ParameterList extends java.lang.ObjectA list of MIME parameters. MIME parameters are name-value pairs associated with a MIME header.- Version:
- 1.4
- Author:
- Chris Burdess
-
-
Constructor Summary
Constructors Constructor Description ParameterList()Constructor for an empty parameter list.ParameterList(java.lang.String s)Constructor with a parameter-list string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringget(java.lang.String name)Returns the value of the specified parameter.java.util.EnumerationgetNames()Returns the names of all parameters in this list.voidremove(java.lang.String name)Removes the specified parameter from this list.voidset(java.lang.String name, java.lang.String value)Sets the specified parameter.voidset(java.lang.String name, java.lang.String value, java.lang.String charset)Sets the specified parameter.intsize()Returns the number of parameters in this list.java.lang.StringtoString()Returns the MIME string representation of this parameter list.java.lang.StringtoString(int used)Returns the MIME string representation of this parameter list.
-
-
-
Constructor Detail
-
ParameterList
public ParameterList()
Constructor for an empty parameter list.
-
ParameterList
public ParameterList(java.lang.String s) throws ParseExceptionConstructor with a parameter-list string.- Parameters:
s- the parameter-list string- Throws:
ParseException- if the parse fails
-
-
Method Detail
-
size
public int size()
Returns the number of parameters in this list.
-
get
public java.lang.String get(java.lang.String name)
Returns the value of the specified parameter. Parameter names are case insensitive.- Parameters:
name- the parameter name
-
set
public void set(java.lang.String name, java.lang.String value)Sets the specified parameter.- Parameters:
name- the parameter namevalue- the parameter value
-
set
public void set(java.lang.String name, java.lang.String value, java.lang.String charset)Sets the specified parameter.- Parameters:
name- the parameter namevalue- the parameter valuecharset- the character set to use to encode the value, ifmail.mime.encodeparametersis true.- Since:
- JavaMail 1.5
-
remove
public void remove(java.lang.String name)
Removes the specified parameter from this list.- Parameters:
name- the parameter name
-
getNames
public java.util.Enumeration getNames()
Returns the names of all parameters in this list.- Returns:
- an Enumeration of String
-
toString
public java.lang.String toString()
Returns the MIME string representation of this parameter list.- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(int used)
Returns the MIME string representation of this parameter list.- Parameters:
used- the number of character positions already used in the field into which the parameter list is to be inserted
-
-