1 21 22 27 28 package javax.activation; 29 30 31 39 public abstract class CommandMap { 40 private static CommandMap defaultCommandMap = null; 41 42 59 public static CommandMap getDefaultCommandMap() { 60 if (defaultCommandMap == null) 61 defaultCommandMap = new MailcapCommandMap (); 62 63 return defaultCommandMap; 64 } 65 66 74 public static void setDefaultCommandMap(CommandMap commandMap) { 75 SecurityManager security = System.getSecurityManager(); 76 if (security != null) { 77 try { 78 security.checkSetFactory(); 80 } catch (SecurityException ex) { 81 if (CommandMap .class.getClassLoader() != 85 commandMap.getClass().getClassLoader()) 86 throw ex; 87 } 88 } 89 defaultCommandMap = commandMap; 90 } 91 92 99 abstract public CommandInfo [] getPreferredCommands(String mimeType); 100 101 116 public CommandInfo [] getPreferredCommands(String mimeType, DataSource ds) { 117 return getPreferredCommands(mimeType); 118 } 119 120 127 abstract public CommandInfo [] getAllCommands(String mimeType); 128 129 144 public CommandInfo [] getAllCommands(String mimeType, DataSource ds) { 145 return getAllCommands(mimeType); 146 } 147 148 155 abstract public CommandInfo getCommand(String mimeType, String cmdName); 156 157 172 public CommandInfo getCommand(String mimeType, String cmdName, 173 DataSource ds) { 174 return getCommand(mimeType, cmdName); 175 } 176 177 185 abstract public DataContentHandler createDataContentHandler(String 186 mimeType); 187 188 204 public DataContentHandler createDataContentHandler(String mimeType, 205 DataSource ds) { 206 return createDataContentHandler(mimeType); 207 } 208 209 217 public String [] getMimeTypes() { 218 return null; 219 } 220 } 221 | Popular Tags |