KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > ReferenceUriSchemesSupported


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
9 import javax.print.attribute.EnumSyntax JavaDoc;
10 import javax.print.attribute.Attribute JavaDoc;
11
12 /**
13  * Class ReferenceUriSchemesSupported is a printing attribute class
14  * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
15  * that a printer can use to retrieve print data stored at a URI location.
16  * If a printer supports doc flavors with a print data representation class of
17  * <CODE>"java.net.URL"</CODE>, the printer uses instances of class
18  * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
19  * The acceptable URI schemes are included as service attributes in the
20  * lookup service; this lets clients search the
21  * for printers that can get print data using a certain URI scheme. The
22  * acceptable URI schemes can also be queried using the capability methods in
23  * interface <code>PrintService</code>. However,
24  * ReferenceUriSchemesSupported attributes are used solely for determining
25  * acceptable URI schemes, they are never included in a doc's,
26  * print request's, print job's, or print service's attribute set.
27  * <P>
28  * The Internet Assigned Numbers Authority maintains the
29  * <A HREF="http://www.isi.edu/in-notes/iana/assignments/url-schemes">official
30  * list of URI schemes</A>.
31  * <p>
32  * Class ReferenceUriSchemesSupported defines enumeration values for widely
33  * used URI schemes. A printer that supports additional URI schemes
34  * can define them in a subclass of class ReferenceUriSchemesSupported.
35  * <P>
36  * <B>IPP Compatibility:</B> The category name returned by
37  * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
38  * integer value is the IPP enum value. The <code>toString()</code> method
39  * returns the IPP string representation of the attribute value.
40  * <P>
41  *
42  * @author Alan Kaminsky
43  */

44 public class ReferenceUriSchemesSupported
45     extends EnumSyntax JavaDoc implements Attribute JavaDoc {
46
47     private static final long serialVersionUID = -8989076942813442805L;
48
49     /**
50      * File Transfer Protocol (FTP).
51      */

52     public static final ReferenceUriSchemesSupported JavaDoc FTP =
53     new ReferenceUriSchemesSupported JavaDoc(0);
54
55     /**
56      * HyperText Transfer Protocol (HTTP).
57      */

58     public static final ReferenceUriSchemesSupported JavaDoc HTTP = new ReferenceUriSchemesSupported JavaDoc(1);
59
60     /**
61      * Secure HyperText Transfer Protocol (HTTPS).
62      */

63     public static final ReferenceUriSchemesSupported JavaDoc HTTPS = new ReferenceUriSchemesSupported JavaDoc(2);
64
65     /**
66      * Gopher Protocol.
67      */

68     public static final ReferenceUriSchemesSupported JavaDoc GOPHER = new ReferenceUriSchemesSupported JavaDoc(3);
69
70     /**
71      * USENET news.
72      */

73     public static final ReferenceUriSchemesSupported JavaDoc NEWS = new ReferenceUriSchemesSupported JavaDoc(4);
74
75     /**
76      * USENET news using Network News Transfer Protocol (NNTP).
77      */

78     public static final ReferenceUriSchemesSupported JavaDoc NNTP = new ReferenceUriSchemesSupported JavaDoc(5);
79
80     /**
81      * Wide Area Information Server (WAIS) protocol.
82      */

83     public static final ReferenceUriSchemesSupported JavaDoc WAIS = new ReferenceUriSchemesSupported JavaDoc(6);
84
85     /**
86      * Host-specific file names.
87      */

88     public static final ReferenceUriSchemesSupported JavaDoc FILE = new ReferenceUriSchemesSupported JavaDoc(7);
89
90     /**
91      * Construct a new reference URI scheme enumeration value with the given
92      * integer value.
93      *
94      * @param value Integer value.
95      */

96     protected ReferenceUriSchemesSupported(int value) {
97     super (value);
98     }
99
100     private static final String JavaDoc[] myStringTable = {
101     "ftp",
102     "http",
103     "https",
104     "gopher",
105     "news",
106     "nntp",
107     "wais",
108     "file",
109     };
110
111     private static final ReferenceUriSchemesSupported JavaDoc[] myEnumValueTable = {
112     FTP,
113     HTTP,
114     HTTPS,
115     GOPHER,
116     NEWS,
117     NNTP,
118     WAIS,
119     FILE,
120     };
121
122     /**
123      * Returns the string table for class ReferenceUriSchemesSupported.
124      */

125     protected String JavaDoc[] getStringTable() {
126     return (String JavaDoc[])myStringTable.clone();
127     }
128
129     /**
130      * Returns the enumeration value table for class
131      * ReferenceUriSchemesSupported.
132      */

133     protected EnumSyntax JavaDoc[] getEnumValueTable() {
134     return (EnumSyntax JavaDoc[])myEnumValueTable.clone();
135     }
136
137     /**
138      * Get the printing attribute class which is to be used as the "category"
139      * for this printing attribute value.
140      * <P>
141      * For class ReferenceUriSchemesSupported and any vendor-defined
142      * subclasses, the category is class ReferenceUriSchemesSupported itself.
143      *
144      * @return Printing attribute class (category), an instance of class
145      * {@link java.lang.Class java.lang.Class}.
146      */

147     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
148     return ReferenceUriSchemesSupported JavaDoc.class;
149     }
150
151     /**
152      * Get the name of the category of which this attribute value is an
153      * instance.
154      * <P>
155      * For class ReferenceUriSchemesSupported and any vendor-defined
156      * subclasses, the category name is
157      * <CODE>"reference-uri-schemes-supported"</CODE>.
158      *
159      * @return Attribute category name.
160      */

161     public final String JavaDoc getName() {
162     return "reference-uri-schemes-supported";
163     }
164
165 }
166
Popular Tags