javax.activation

Class CommandMap

Known Direct Subclasses:
MailcapCommandMap

public abstract class CommandMap
extends Object

Registry of command objects available to the system.

Method Summary

abstract DataContentHandler
createDataContentHandler(String mimeType)
Returns a DataContentHandler corresponding to the MIME type.
abstract CommandInfo[]
getAllCommands(String mimeType)
Returns the complete list of commands for a MIME type.
abstract CommandInfo
getCommand(String mimeType, String cmdName)
Returns the command corresponding to the specified MIME type and command name.
static CommandMap
getDefaultCommandMap()
Returns the default command map.
abstract CommandInfo[]
getPreferredCommands(String mimeType)
Returns the list of preferred commands for a MIME type.
static void
setDefaultCommandMap(CommandMap commandMap)
Sets the default command map.

Method Details

createDataContentHandler

public abstract DataContentHandler createDataContentHandler(String mimeType)
Returns a DataContentHandler corresponding to the MIME type.
Parameters:
mimeType - the MIME type

getAllCommands

public abstract CommandInfo[] getAllCommands(String mimeType)
Returns the complete list of commands for a MIME type.
Parameters:
mimeType - the MIME type

getCommand

public abstract CommandInfo getCommand(String mimeType,
                                       String cmdName)
Returns the command corresponding to the specified MIME type and command name.
Parameters:
mimeType - the MIME type
cmdName - the command name

getDefaultCommandMap

public static CommandMap getDefaultCommandMap()
Returns the default command map. This returns a MailcapCommandMap if no value has been set using setDefaultCommandMap.

getPreferredCommands

public abstract CommandInfo[] getPreferredCommands(String mimeType)
Returns the list of preferred commands for a MIME type.
Parameters:
mimeType - the MIME type

setDefaultCommandMap

public static void setDefaultCommandMap(CommandMap commandMap)
Sets the default command map.
Parameters:
commandMap - the new default command map