Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.activation
Class HierarchicCommandMap

java.lang.Object
  extended by javax.activation.CommandMap
      extended by ch.randelshofer.activation.BasicCommandMap
          extended by ch.randelshofer.activation.HierarchicCommandMap

public class HierarchicCommandMap
extends BasicCommandMap

This command map allows the specification of generic commands, that can be applied to multiple mime types. e.g When commands are queried for the file type "audio/basic", this map returns all the commands for the file types "audio/basic", "audio/*" and "* /*".

Version:
1.1 2000-09-30 Method #removeDuplicates is more restrict when removing duplicates.
1.0 1999-10-19
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Immensee, Switzerland.

Constructor Summary
HierarchicCommandMap()
           
 
Method Summary
 javax.activation.DataContentHandler createDataContentHandler(java.lang.String mimeType)
          Locate a DataContentHandler that corresponds to the MIME type.
 javax.activation.CommandInfo[] getAllCommands(java.lang.String mimeType)
          Get all the available commands for this type.
 javax.activation.CommandInfo getCommand(java.lang.String mimeType, java.lang.String cmdName)
          Get the default command corresponding to the MIME type.
 javax.activation.CommandInfo[] getPreferredCommands(java.lang.String mimeType)
          Get the preferred command list from a MIME Type.
 
Methods inherited from class ch.randelshofer.activation.BasicCommandMap
addCommand, addCommandInfo, addCommands
 
Methods inherited from class javax.activation.CommandMap
createDataContentHandler, getAllCommands, getCommand, getDefaultCommandMap, getMimeTypes, getPreferredCommands, setDefaultCommandMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicCommandMap

public HierarchicCommandMap()
Method Detail

getPreferredCommands

public javax.activation.CommandInfo[] getPreferredCommands(java.lang.String mimeType)
Get the preferred command list from a MIME Type. e.g When commands are queried for the file type "audio/basic", this map returns all the commands for the file types "audio/basic", "audio/*" and "* /*".

Overrides:
getPreferredCommands in class BasicCommandMap
Returns:
the CommandInfo classes the represent the command Beans.

getAllCommands

public javax.activation.CommandInfo[] getAllCommands(java.lang.String mimeType)
Get all the available commands for this type. This method should return all the possible commands for this MIME type.

Overrides:
getAllCommands in class BasicCommandMap
Returns:
returns the CommandInfo objects representing all the commands.

getCommand

public javax.activation.CommandInfo getCommand(java.lang.String mimeType,
                                               java.lang.String cmdName)
Get the default command corresponding to the MIME type.

Overrides:
getCommand in class BasicCommandMap
Returns:
the CommandInfo corresponding to the command.

createDataContentHandler

public javax.activation.DataContentHandler createDataContentHandler(java.lang.String mimeType)
Locate a DataContentHandler that corresponds to the MIME type. The mechanism and semantics for determining this are determined by the implementation of the particular CommandMap.

Overrides:
createDataContentHandler in class BasicCommandMap

Copyright 2012-02-25 Werner Randelshofer