1. /*
  2. * @(#)ReferenceUriSchemesSupported.java 1.9 04/05/05
  3. *
  4. * Copyright 2004 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. private static final long serialVersionUID = -8989076942813442805L;
  45. /**
  46. * File Transfer Protocol (FTP).
  47. */
  48. public static final ReferenceUriSchemesSupported FTP =
  49. new ReferenceUriSchemesSupported(0);
  50. /**
  51. * HyperText Transfer Protocol (HTTP).
  52. */
  53. public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(1);
  54. /**
  55. * Secure HyperText Transfer Protocol (HTTPS).
  56. */
  57. public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(2);
  58. /**
  59. * Gopher Protocol.
  60. */
  61. public static final ReferenceUriSchemesSupported GOPHER = new ReferenceUriSchemesSupported(3);
  62. /**
  63. * USENET news.
  64. */
  65. public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(4);
  66. /**
  67. * USENET news using Network News Transfer Protocol (NNTP).
  68. */
  69. public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(5);
  70. /**
  71. * Wide Area Information Server (WAIS) protocol.
  72. */
  73. public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(6);
  74. /**
  75. * Host-specific file names.
  76. */
  77. public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
  78. /**
  79. * Construct a new reference URI scheme enumeration value with the given
  80. * integer value.
  81. *
  82. * @param value Integer value.
  83. */
  84. protected ReferenceUriSchemesSupported(int value) {
  85. super (value);
  86. }
  87. private static final String[] myStringTable = {
  88. "ftp",
  89. "http",
  90. "https",
  91. "gopher",
  92. "news",
  93. "nntp",
  94. "wais",
  95. "file",
  96. };
  97. private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
  98. FTP,
  99. HTTP,
  100. HTTPS,
  101. GOPHER,
  102. NEWS,
  103. NNTP,
  104. WAIS,
  105. FILE,
  106. };
  107. /**
  108. * Returns the string table for class ReferenceUriSchemesSupported.
  109. */
  110. protected String[] getStringTable() {
  111. return (String[])myStringTable.clone();
  112. }
  113. /**
  114. * Returns the enumeration value table for class
  115. * ReferenceUriSchemesSupported.
  116. */
  117. protected EnumSyntax[] getEnumValueTable() {
  118. return (EnumSyntax[])myEnumValueTable.clone();
  119. }
  120. /**
  121. * Get the printing attribute class which is to be used as the "category"
  122. * for this printing attribute value.
  123. * <P>
  124. * For class ReferenceUriSchemesSupported and any vendor-defined
  125. * subclasses, the category is class ReferenceUriSchemesSupported itself.
  126. *
  127. * @return Printing attribute class (category), an instance of class
  128. * {@link java.lang.Class java.lang.Class}.
  129. */
  130. public final Class<? extends Attribute> getCategory() {
  131. return ReferenceUriSchemesSupported.class;
  132. }
  133. /**
  134. * Get the name of the category of which this attribute value is an
  135. * instance.
  136. * <P>
  137. * For class ReferenceUriSchemesSupported and any vendor-defined
  138. * subclasses, the category name is
  139. * <CODE>"reference-uri-schemes-supported"</CODE>.
  140. *
  141. * @return Attribute category name.
  142. */
  143. public final String getName() {
  144. return "reference-uri-schemes-supported";
  145. }
  146. }