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