jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
author chegar
Fri, 10 Feb 2012 11:03:20 +0000
changeset 11813 643f5bef6ab4
parent 5506 202f599c92aa
child 14342 8435a30053c1
permissions -rw-r--r--
7144475: fix some warnings in java.awt, javax.print.attribute.standard, and sun.beans.infos Reviewed-by: chegar, prr, alanb, anthony Contributed-by: Prasannaa <prasannaa_ss@yahoo.com>, Martijn Verburg <martijnverburg@gmail.com>, Goerge Albrecht <goerge.albrecht@gmx.net>, Graham Allan <grundlefleck@googlemail.com>, Iordanis Giannakakis <i.giannakakis@ymail.com>, Jose Llarena <jose.llarena@gmail.com>, Abrahamn Marin Perez <abraham.marin.perez@gmail.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     2
 * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package javax.print.attribute.standard;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import javax.print.attribute.EnumSyntax;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.print.attribute.Attribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * Class ReferenceUriSchemesSupported is a printing attribute class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * that a printer can use to retrieve print data stored at a URI location.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * If a printer supports doc flavors with a print data representation class of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <CODE>"java.net.URL"</CODE>, the printer uses instances of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * The acceptable URI schemes are included as service attributes in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * lookup service; this lets clients search the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * for printers that can get print data using a certain URI scheme. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * acceptable URI schemes can also be queried using the capability methods in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * interface <code>PrintService</code>. However,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * ReferenceUriSchemesSupported attributes are used solely for determining
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * acceptable URI schemes, they are never included in a doc's,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * print request's, print job's, or print service's attribute set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * The Internet Assigned Numbers Authority maintains the
537
43192316f353 6638477: Two external URLS referenced in 2D documentation are no longer functioning.
prr
parents: 2
diff changeset
    47
 * <A HREF="http://www.iana.org/assignments/uri-schemes.html">official
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * list of URI schemes</A>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * Class ReferenceUriSchemesSupported defines enumeration values for widely
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * used URI schemes. A printer that supports additional URI schemes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * can define them in a subclass of class ReferenceUriSchemesSupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * <B>IPP Compatibility:</B>  The category name returned by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * integer value is the IPP enum value.  The <code>toString()</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * returns the IPP string representation of the attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
public class ReferenceUriSchemesSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    extends EnumSyntax implements Attribute {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    private static final long serialVersionUID = -8989076942813442805L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * File Transfer Protocol (FTP).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public static final ReferenceUriSchemesSupported FTP =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        new ReferenceUriSchemesSupported(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * HyperText Transfer Protocol (HTTP).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * Secure HyperText Transfer Protocol (HTTPS).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Gopher Protocol.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public static final ReferenceUriSchemesSupported GOPHER = new ReferenceUriSchemesSupported(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * USENET news.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * USENET news using Network News Transfer Protocol (NNTP).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(5);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * Wide Area Information Server (WAIS) protocol.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(6);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Host-specific file names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * Construct a new reference URI scheme enumeration value with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * integer value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * @param  value  Integer value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    protected ReferenceUriSchemesSupported(int value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        super (value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    private static final String[] myStringTable = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        "ftp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        "http",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        "https",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        "gopher",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        "news",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        "nntp",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        "wais",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        "file",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        FTP,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        HTTP,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        HTTPS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        GOPHER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        NEWS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        NNTP,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        WAIS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        FILE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Returns the string table for class ReferenceUriSchemesSupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    protected String[] getStringTable() {
11813
643f5bef6ab4 7144475: fix some warnings in java.awt, javax.print.attribute.standard, and sun.beans.infos
chegar
parents: 5506
diff changeset
   144
        return myStringTable.clone();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * Returns the enumeration value table for class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * ReferenceUriSchemesSupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    protected EnumSyntax[] getEnumValueTable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        return (EnumSyntax[])myEnumValueTable.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Get the printing attribute class which is to be used as the "category"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * for this printing attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * For class ReferenceUriSchemesSupported and any vendor-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * subclasses, the category is class ReferenceUriSchemesSupported itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * @return  Printing attribute class (category), an instance of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     *          {@link java.lang.Class java.lang.Class}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    public final Class<? extends Attribute> getCategory() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        return ReferenceUriSchemesSupported.class;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Get the name of the category of which this attribute value is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * For class ReferenceUriSchemesSupported and any vendor-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * subclasses, the category name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * <CODE>"reference-uri-schemes-supported"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @return  Attribute category name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    public final String getName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        return "reference-uri-schemes-supported";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
}