javax.activation
Class CommandMap

java.lang.Object
  extended by javax.activation.CommandMap
Direct Known Subclasses:
MailcapCommandMap

public abstract class CommandMap
extends java.lang.Object

Version:
$Rev: 513099 $ $Date: 2007-03-01 02:47:39 +0100 (Thu, 01 Mar 2007) $

Constructor Summary
CommandMap()
           
 
Method Summary
abstract  DataContentHandler createDataContentHandler(java.lang.String mimeType)
          Locate a DataContentHandler for the given mime type.
 DataContentHandler createDataContentHandler(java.lang.String mimeType, DataSource ds)
          Locate a DataContentHandler for the given mime type.
abstract  CommandInfo[] getAllCommands(java.lang.String mimeType)
          Get all available commands for the given mimetype.
 CommandInfo[] getAllCommands(java.lang.String mimeType, DataSource ds)
          Get the entire command set for the given mimetype, as modified by the DataSource.
abstract  CommandInfo getCommand(java.lang.String mimeType, java.lang.String cmdName)
          Get the default command implementation for a give mimeType
 CommandInfo getCommand(java.lang.String mimeType, java.lang.String cmdName, DataSource ds)
          Get the default command implementation for a given mimeType/DataSource combo.
static CommandMap getDefaultCommandMap()
          Return the default CommandMap.
 java.lang.String[] getMimeTypes()
          Return all mime types known to this CommandMap, or null if none.
abstract  CommandInfo[] getPreferredCommands(java.lang.String mimeType)
          Get the preferred commands for the given mimetype.
 CommandInfo[] getPreferredCommands(java.lang.String mimeType, DataSource ds)
          Get the preferred commands for the given mimetype, as modified by the DataSource.
static void setDefaultCommandMap(CommandMap commandMap)
          Set the default CommandMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandMap

public CommandMap()
Method Detail

getDefaultCommandMap

public static CommandMap getDefaultCommandMap()
Return the default CommandMap. If this has not been explictly set using setDefaultCommandMap() then a MailcapCommandMap is returned.

Returns:
the default CommandMap

setDefaultCommandMap

public static void setDefaultCommandMap(CommandMap commandMap)
Set the default CommandMap.

Parameters:
commandMap - the new default CommandMap; if null resets to a MailcapCommandMap
Throws:
java.lang.SecurityException - if the caller does not have "SetFactory" RuntimePermission

getPreferredCommands

public CommandInfo[] getPreferredCommands(java.lang.String mimeType,
                                          DataSource ds)
Get the preferred commands for the given mimetype, as modified by the DataSource. The default implementation is just a delegation to getPreferredCommands(mimeType), but the concrete implementations can define additional behavior.

Parameters:
mimeType - The mimeType name.
ds - The datasource providing the type object.
Returns:
The array of CommandInfo[] objects associated with this mimeType/DataSource combo.

getPreferredCommands

public abstract CommandInfo[] getPreferredCommands(java.lang.String mimeType)
Get the preferred commands for the given mimetype. The concrete implementations define the actual behaviour.

Parameters:
mimeType - The mimeType name.
Returns:
The array of CommandInfo[] objects associated with this mimeType combo.

getAllCommands

public CommandInfo[] getAllCommands(java.lang.String mimeType,
                                    DataSource ds)
Get the entire command set for the given mimetype, as modified by the DataSource. The default implementation is just a delegation to getAllCommands(mimeType), but the concrete implementations can define additional behavior.

Parameters:
mimeType - The mimeType name.
ds - The datasource providing the type object.
Returns:
The array of CommandInfo[] objects associated with this mimeType/DataSource combo.

getAllCommands

public abstract CommandInfo[] getAllCommands(java.lang.String mimeType)
Get all available commands for the given mimetype. The concrete implementations define the actual behaviour.

Parameters:
mimeType - The mimeType name.
Returns:
The array of CommandInfo[] objects associated with this mimeType combo.

getCommand

public CommandInfo getCommand(java.lang.String mimeType,
                              java.lang.String cmdName,
                              DataSource ds)
Get the default command implementation for a given mimeType/DataSource combo. The default implementation just delegates to getCommand(mimeType, cmdName). Subclasses may provide more specialized behavior.

Parameters:
mimeType - The name of the mime type
cmdName - The command action we wish to perform.
ds - The modifying DataSource.
Returns:
A CommandInfo object corresponding to the command mapping.

getCommand

public abstract CommandInfo getCommand(java.lang.String mimeType,
                                       java.lang.String cmdName)
Get the default command implementation for a give mimeType

Parameters:
mimeType - The name of the mime type
cmdName - The command action we wish to perform.
Returns:
A CommandInfo object corresponding to the command mapping.

createDataContentHandler

public DataContentHandler createDataContentHandler(java.lang.String mimeType,
                                                   DataSource ds)
Locate a DataContentHandler for the given mime type. The concrete implementations determine how this mapping is performed.

Parameters:
mimeType - The target MIME type.
ds - The DataSource associated with this request.
Returns:
The DataContentHandler for the MIME type.

createDataContentHandler

public abstract DataContentHandler createDataContentHandler(java.lang.String mimeType)
Locate a DataContentHandler for the given mime type. The concrete implementations determine how this mapping is performed.

Parameters:
mimeType - The target MIME type.
Returns:
The DataContentHandler for the MIME type.

getMimeTypes

public java.lang.String[] getMimeTypes()
Return all mime types known to this CommandMap, or null if none.

Returns:
a String array of all mime types known to this CommandMap


Copyright © 2009. All Rights Reserved.