1. /*
  2. * @(#)ReferenceUriSchemesSupported.java 1.6 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.attribute.standard;
  8. import javax.print.attribute.EnumSyntax;
  9. import javax.print.attribute.Attribute;
  10. /**
  11. * Class ReferenceUriSchemesSupported is a printing attribute class
  12. * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
  13. * that a printer can use to retrieve print data stored at a URI location.
  14. * If a printer supports doc flavors with a print data representation class of
  15. * <CODE>"java.net.URL"</CODE>, the printer uses instances of class
  16. * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
  17. * The acceptable URI schemes are included as service attributes in the
  18. * lookup service; this lets clients search the
  19. * for printers that can get print data using a certain URI scheme. The
  20. * acceptable URI schemes can also be queried using the capability methods in
  21. * interface <code>PrintService</code>. However,
  22. * ReferenceUriSchemesSupported attributes are used solely for determining
  23. * acceptable URI schemes, they are never included in a doc's,
  24. * print request's, print job's, or print service's attribute set.
  25. * <P>
  26. * The Internet Assigned Numbers Authority maintains the
  27. * <A HREF="http://www.isi.edu/in-notes/iana/assignments/url-schemes">official
  28. * list of URI schemes</A>.
  29. * <p>
  30. * Class ReferenceUriSchemesSupported defines enumeration values for widely
  31. * used URI schemes. A printer that supports additional URI schemes
  32. * can define them in a subclass of class ReferenceUriSchemesSupported.
  33. * <P>
  34. * <B>IPP Compatibility:</B> The category name returned by
  35. * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
  36. * integer value is the IPP enum value. The <code>toString()</code> method
  37. * returns the IPP string representation of the attribute value.
  38. * <P>
  39. *
  40. * @author Alan Kaminsky
  41. */
  42. public class ReferenceUriSchemesSupported
  43. extends EnumSyntax implements Attribute {
  44. /**
  45. * File Transfer Protocol (FTP).
  46. */
  47. public static final ReferenceUriSchemesSupported FTP =
  48. new ReferenceUriSchemesSupported(0);
  49. /**
  50. * HyperText Transfer Protocol (HTTP).
  51. */
  52. public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(1);
  53. /**
  54. * Secure HyperText Transfer Protocol (HTTPS).
  55. */
  56. public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(2);
  57. /**
  58. * Gopher Protocol.
  59. */
  60. public static final ReferenceUriSchemesSupported GOPHER = new ReferenceUriSchemesSupported(3);
  61. /**
  62. * USENET news.
  63. */
  64. public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(4);
  65. /**
  66. * USENET news using Network News Transfer Protocol (NNTP).
  67. */
  68. public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(5);
  69. /**
  70. * Wide Area Information Server (WAIS) protocol.
  71. */
  72. public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(6);
  73. /**
  74. * Host-specific file names.
  75. */
  76. public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
  77. /**
  78. * Construct a new reference URI scheme enumeration value with the given
  79. * integer value.
  80. *
  81. * @param value Integer value.
  82. */
  83. protected ReferenceUriSchemesSupported(int value) {
  84. super (value);
  85. }
  86. private static final String[] myStringTable = {
  87. "ftp",
  88. "http",
  89. "https",
  90. "gopher",
  91. "news",
  92. "nntp",
  93. "wais",
  94. "file",
  95. };
  96. private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
  97. FTP,
  98. HTTP,
  99. HTTPS,
  100. GOPHER,
  101. NEWS,
  102. NNTP,
  103. WAIS,
  104. FILE,
  105. };
  106. /**
  107. * Returns the string table for class ReferenceUriSchemesSupported.
  108. */
  109. protected String[] getStringTable() {
  110. return (String[])myStringTable.clone();
  111. }
  112. /**
  113. * Returns the enumeration value table for class
  114. * ReferenceUriSchemesSupported.
  115. */
  116. protected EnumSyntax[] getEnumValueTable() {
  117. return (EnumSyntax[])myEnumValueTable.clone();
  118. }
  119. /**
  120. * Get the printing attribute class which is to be used as the "category"
  121. * for this printing attribute value.
  122. * <P>
  123. * For class ReferenceUriSchemesSupported and any vendor-defined
  124. * subclasses, the category is class ReferenceUriSchemesSupported itself.
  125. *
  126. * @return Printing attribute class (category), an instance of class
  127. * {@link java.lang.Class java.lang.Class}.
  128. */
  129. public final Class getCategory() {
  130. return ReferenceUriSchemesSupported.class;
  131. }
  132. /**
  133. * Get the name of the category of which this attribute value is an
  134. * instance.
  135. * <P>
  136. * For class ReferenceUriSchemesSupported and any vendor-defined
  137. * subclasses, the category name is
  138. * <CODE>"reference-uri-schemes-supported"</CODE>.
  139. *
  140. * @return Attribute category name.
  141. */
  142. public final String getName() {
  143. return "reference-uri-schemes-supported";
  144. }
  145. }