|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.internet.ParameterList
public class ParameterList
This class holds MIME parameters (attribute-value pairs).
The mail.mime.encodeparameters
and
mail.mime.decodeparameters
System properties
control whether encoded parameters, as specified by
RFC 2231,
are supported. By default, such encoded parameters are not
supported.
Also, in the current implementation, setting the System property
mail.mime.decodeparameters.strict
to "true"
will cause a ParseException
to be thrown for errors
detected while decoding encoded parameters. By default, if any
decoding errors occur, the original (undecoded) string is used.
The current implementation supports the System property
mail.mime.parameters.strict
, which if set to false
when parsing a parameter list allows parameter values
to contain whitespace and other special characters without
being quoted; the parameter value ends at the next semicolon.
If set to true (the default), parameter values are required to conform
to the MIME specification and must be quoted if they contain whitespace
or special characters.
Constructor Summary | |
---|---|
ParameterList()
No-arg Constructor. |
|
ParameterList(java.lang.String s)
Constructor that takes a parameter-list string. |
Method Summary | |
---|---|
java.lang.String |
get(java.lang.String name)
Returns the value of the specified parameter. |
java.util.Enumeration |
getNames()
Return an enumeration of the names of all parameters in this list. |
void |
remove(java.lang.String name)
Removes the specified parameter from this ParameterList. |
void |
set(java.lang.String name,
java.lang.String value)
Set a parameter. |
void |
set(java.lang.String name,
java.lang.String value,
java.lang.String charset)
Set a parameter. |
int |
size()
Return the number of parameters in this list. |
java.lang.String |
toString()
Convert this ParameterList into a MIME String. |
java.lang.String |
toString(int used)
Convert this ParameterList into a MIME String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ParameterList()
public ParameterList(java.lang.String s) throws ParseException
s
- the parameter-list string.
ParseException
- if the parse fails.Method Detail |
---|
public int size()
public java.lang.String get(java.lang.String name)
name
- parameter name.
null
if the parameter is not
present.public void set(java.lang.String name, java.lang.String value)
name
- name of the parameter.value
- value of the parameter.public void set(java.lang.String name, java.lang.String value, java.lang.String charset)
mail.mime.encodeparameters
System property
is true, and the parameter value is non-ASCII, it will be
encoded with the specified charset, as specified by RFC 2231.
name
- name of the parameter.value
- value of the parameter.charset
- charset of the parameter value.public void remove(java.lang.String name)
name
- name of the parameter.public java.util.Enumeration getNames()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int used)
used
- number of character positions already used, in
the field into which the parameter list is to
be inserted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41