001 /*
002 * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025 package javax.print.attribute.standard;
026
027 import javax.print.attribute.EnumSyntax;
028 import javax.print.attribute.Attribute;
029
030 /**
031 * Class ReferenceUriSchemesSupported is a printing attribute class
032 * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
033 * that a printer can use to retrieve print data stored at a URI location.
034 * If a printer supports doc flavors with a print data representation class of
035 * <CODE>"java.net.URL"</CODE>, the printer uses instances of class
036 * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
037 * The acceptable URI schemes are included as service attributes in the
038 * lookup service; this lets clients search the
039 * for printers that can get print data using a certain URI scheme. The
040 * acceptable URI schemes can also be queried using the capability methods in
041 * interface <code>PrintService</code>. However,
042 * ReferenceUriSchemesSupported attributes are used solely for determining
043 * acceptable URI schemes, they are never included in a doc's,
044 * print request's, print job's, or print service's attribute set.
045 * <P>
046 * The Internet Assigned Numbers Authority maintains the
047 * <A HREF="http://www.isi.edu/in-notes/iana/assignments/url-schemes">official
048 * list of URI schemes</A>.
049 * <p>
050 * Class ReferenceUriSchemesSupported defines enumeration values for widely
051 * used URI schemes. A printer that supports additional URI schemes
052 * can define them in a subclass of class ReferenceUriSchemesSupported.
053 * <P>
054 * <B>IPP Compatibility:</B> The category name returned by
055 * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
056 * integer value is the IPP enum value. The <code>toString()</code> method
057 * returns the IPP string representation of the attribute value.
058 * <P>
059 *
060 * @author Alan Kaminsky
061 */
062 public class ReferenceUriSchemesSupported extends EnumSyntax implements
063 Attribute {
064
065 private static final long serialVersionUID = -8989076942813442805L;
066
067 /**
068 * File Transfer Protocol (FTP).
069 */
070 public static final ReferenceUriSchemesSupported FTP = new ReferenceUriSchemesSupported(
071 0);
072
073 /**
074 * HyperText Transfer Protocol (HTTP).
075 */
076 public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(
077 1);
078
079 /**
080 * Secure HyperText Transfer Protocol (HTTPS).
081 */
082 public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(
083 2);
084
085 /**
086 * Gopher Protocol.
087 */
088 public static final ReferenceUriSchemesSupported GOPHER = new ReferenceUriSchemesSupported(
089 3);
090
091 /**
092 * USENET news.
093 */
094 public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(
095 4);
096
097 /**
098 * USENET news using Network News Transfer Protocol (NNTP).
099 */
100 public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(
101 5);
102
103 /**
104 * Wide Area Information Server (WAIS) protocol.
105 */
106 public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(
107 6);
108
109 /**
110 * Host-specific file names.
111 */
112 public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(
113 7);
114
115 /**
116 * Construct a new reference URI scheme enumeration value with the given
117 * integer value.
118 *
119 * @param value Integer value.
120 */
121 protected ReferenceUriSchemesSupported(int value) {
122 super (value);
123 }
124
125 private static final String[] myStringTable = { "ftp", "http",
126 "https", "gopher", "news", "nntp", "wais", "file", };
127
128 private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
129 FTP, HTTP, HTTPS, GOPHER, NEWS, NNTP, WAIS, FILE, };
130
131 /**
132 * Returns the string table for class ReferenceUriSchemesSupported.
133 */
134 protected String[] getStringTable() {
135 return (String[]) myStringTable.clone();
136 }
137
138 /**
139 * Returns the enumeration value table for class
140 * ReferenceUriSchemesSupported.
141 */
142 protected EnumSyntax[] getEnumValueTable() {
143 return (EnumSyntax[]) myEnumValueTable.clone();
144 }
145
146 /**
147 * Get the printing attribute class which is to be used as the "category"
148 * for this printing attribute value.
149 * <P>
150 * For class ReferenceUriSchemesSupported and any vendor-defined
151 * subclasses, the category is class ReferenceUriSchemesSupported itself.
152 *
153 * @return Printing attribute class (category), an instance of class
154 * {@link java.lang.Class java.lang.Class}.
155 */
156 public final Class<? extends Attribute> getCategory() {
157 return ReferenceUriSchemesSupported.class;
158 }
159
160 /**
161 * Get the name of the category of which this attribute value is an
162 * instance.
163 * <P>
164 * For class ReferenceUriSchemesSupported and any vendor-defined
165 * subclasses, the category name is
166 * <CODE>"reference-uri-schemes-supported"</CODE>.
167 *
168 * @return Attribute category name.
169 */
170 public final String getName() {
171 return "reference-uri-schemes-supported";
172 }
173
174 }
|