1. /*
  2. * @(#)FlavorMap.java 1.14 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt.datatransfer;
  11. import java.util.Map;
  12. /**
  13. * <p>
  14. * The FlavorMap is an interface to a map that maps platform native
  15. * type names (strings) to MIME type strings, and also their associated
  16. * DataFlavors.
  17. * </p>
  18. * This map is used by the DnD system to map platform data types to MIME
  19. * types to enable the transfer of objects between Java and the platform via
  20. * the platform DnD System.
  21. * </p>
  22. *
  23. * @see SystemFlavorMap
  24. *
  25. * @version 1.14, 02/02/00
  26. * @since 1.2
  27. *
  28. */
  29. public interface FlavorMap {
  30. /**
  31. * map flavors to native data types names
  32. *
  33. * @param flavors The array of DataFlavors to map to native types, or null
  34. *
  35. * @return a Map object which contains between 0 or more entries
  36. * with keys of type DataFlavor and values of type String, where the String
  37. * values mapped (if any) are the native (platform dependent) data type
  38. * name corresponding to the (platform independent) DataFlavor (MimeType).
  39. *
  40. * If the parameter is null then the Map returned should be the
  41. * complete map of all mappings between DataFlavors and their
  42. * corresponding native names known to the implementation at the time
  43. * of the call.
  44. *
  45. * The Map returned is mutable and considered to be owned by the caller,
  46. * thus allowing "nesting" of FlavorMap implementations.
  47. */
  48. Map getNativesForFlavors(DataFlavor[] flavors);
  49. /**
  50. * map natives to corresponding flavors
  51. *
  52. * @param native The array of String native types to map to DataFlavors, or null
  53. *
  54. * @return a Map object which contains 0 or more entries
  55. * with keys of type String and values of type DataFlavor, where the
  56. * DataFlavor values mapped (if any) are the (platform independent) types
  57. * corresponding to their native (platform dependent) data type names.
  58. *
  59. * If the parameter is null then the map returned should be the
  60. * complete map of all mappings between native names and their
  61. * corresponding DataFlavors known to the implementation at the time
  62. * of the call.
  63. *
  64. * The Map returned is mutable and considered to be owned by the caller,
  65. * thus allowing "nesting" of FlavorMap implementations.
  66. */
  67. Map getFlavorsForNatives(String[] natives);
  68. }