Top Description Fields Constructors Methods
jakarta.activation

public Class MimeTypeParameterList

extends Object
Class Inheritance
Imports
java.util.Hashtable, .Enumeration, .Locale

A parameter list of a MimeType as defined in RFC 2045 and 2046. The Primary type of the object must already be stripped off.
See Also
jakarta.activation.MimeType

Field Summary

Modifier and TypeField and Description
private Hashtable<String, String>
private static final String
TSPECIALS

A string that holds all the special chars.

Constructor Summary

AccessConstructor and Description
public
MimeTypeParameterList()

Default constructor.

public
MimeTypeParameterList(String
an RFC 2045, 2046 compliant parameter list.
parameterList
)

Constructs a new MimeTypeParameterList with the passed in data.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the parameter's value
get
(String
the parameter name
name
)

Retrieve the value associated with the given name, or null if there is no current association.

public Enumeration<String>

Returns:

an enumeration of all parameter names
getNames
()

Retrieve an enumeration of all the names in this list.

public boolean

Returns:

true if there are no parameters
isEmpty
()

Determine whether or not this list is empty.

private static boolean
isTokenChar(char c)

Determine whether or not a given character belongs to a legal token.

protected void
parse(String
an RFC 2045, 2046 compliant parameter list.
parameterList
)

A routine for parsing the parameter list out of a String.

private static String
quote(String value)

A routine that knows how and when to quote and escape the given value.

public void
remove(String
the parameter name
name
)

Remove any value associated with the given name.

public void
set(String
the parameter name
name
,
String
the parameter's value
value
)

Set the value to be associated with the given name, replacing any previous association.

public int

Returns:

the number of parameters
size
()

Return the number of name-value pairs in this list.

private static int
skipWhiteSpace(String rawdata, int i)

return the index of the first non white space character in rawdata at or after index i.

public String
toString()

Overrides java.lang.Object.toString.

Return a string representation of this object.
private static String
unquote(String value)

A routine that knows how to strip the quotes and escape sequences from the given value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

parametersback to summary
private Hashtable<String, String> parameters
TSPECIALSback to summary
private static final String TSPECIALS

A string that holds all the special chars.

Constructor Detail

MimeTypeParameterListback to summary
public MimeTypeParameterList()

Default constructor.

MimeTypeParameterListback to summary
public MimeTypeParameterList(String parameterList) throws MimeTypeParseException

Constructs a new MimeTypeParameterList with the passed in data.

Parameters
parameterList:String

an RFC 2045, 2046 compliant parameter list.

Exceptions
MimeTypeParseException:
if the MIME type can't be parsed

Method Detail

getback to summary
public String get(String name)

Retrieve the value associated with the given name, or null if there is no current association.

Parameters
name:String

the parameter name

Returns:String

the parameter's value

getNamesback to summary
public Enumeration<String> getNames()

Retrieve an enumeration of all the names in this list.

Returns:Enumeration<String>

an enumeration of all parameter names

isEmptyback to summary
public boolean isEmpty()

Determine whether or not this list is empty.

Returns:boolean

true if there are no parameters

isTokenCharback to summary
private static boolean isTokenChar(char c)

Determine whether or not a given character belongs to a legal token.

parseback to summary
protected void parse(String parameterList) throws MimeTypeParseException

A routine for parsing the parameter list out of a String.

Parameters
parameterList:String

an RFC 2045, 2046 compliant parameter list.

Exceptions
MimeTypeParseException:
if the MIME type can't be parsed
quoteback to summary
private static String quote(String value)

A routine that knows how and when to quote and escape the given value.

removeback to summary
public void remove(String name)

Remove any value associated with the given name.

Parameters
name:String

the parameter name

setback to summary
public void set(String name, String value)

Set the value to be associated with the given name, replacing any previous association.

Parameters
name:String

the parameter name

value:String

the parameter's value

sizeback to summary
public int size()

Return the number of name-value pairs in this list.

Returns:int

the number of parameters

skipWhiteSpaceback to summary
private static int skipWhiteSpace(String rawdata, int i)

return the index of the first non white space character in rawdata at or after index i.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a string representation of this object.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

unquoteback to summary
private static String unquote(String value)

A routine that knows how to strip the quotes and escape sequences from the given value.