< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */

  25 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.EnumSyntax;
  28 import javax.print.attribute.Attribute;

  29 
  30 /**
  31  * Class ReferenceUriSchemesSupported is a printing attribute class
  32  * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
  33  * that a printer can use to retrieve print data stored at a URI location.
  34  * If a printer supports doc flavors with a print data representation class of
  35  * {@code "java.net.URL"}, the printer uses instances of class
  36  * ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
  37  * The acceptable URI schemes are included as service attributes in the
  38  * lookup service; this lets clients search the
  39  * for printers that can get print data using a certain URI scheme. The
  40  * acceptable URI schemes can also be queried using the capability methods in
  41  * interface {@code PrintService}. However,
  42  * ReferenceUriSchemesSupported attributes are used solely for determining
  43  * acceptable URI schemes, they are never included in a doc's,
  44  * print request's, print job's, or print service's attribute set.
  45  * <P>
  46  * The Internet Assigned Numbers Authority maintains the
  47  * <A HREF="http://www.iana.org/assignments/uri-schemes.html">official
  48  * list of URI schemes</A>.
  49  * <p>
  50  * Class ReferenceUriSchemesSupported defines enumeration values for widely
  51  * used URI schemes. A printer that supports additional URI schemes
  52  * can define them in a subclass of class ReferenceUriSchemesSupported.
  53  * <P>
  54  * <B>IPP Compatibility:</B>  The category name returned by
  55  * {@code getName()} is the IPP attribute name.  The enumeration's
  56  * integer value is the IPP enum value.  The {@code toString()} method
  57  * returns the IPP string representation of the attribute value.

  58  *
  59  * @author  Alan Kaminsky
  60  */
  61 public class ReferenceUriSchemesSupported
  62     extends EnumSyntax implements Attribute {
  63 



  64     private static final long serialVersionUID = -8989076942813442805L;
  65 
  66     /**
  67      * File Transfer Protocol (FTP).
  68      */
  69     public static final ReferenceUriSchemesSupported FTP =
  70         new ReferenceUriSchemesSupported(0);
  71 
  72     /**
  73      * HyperText Transfer Protocol (HTTP).
  74      */
  75     public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(1);
  76 
  77     /**
  78      * Secure HyperText Transfer Protocol (HTTPS).
  79      */
  80     public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(2);
  81 
  82     /**
  83      * Gopher Protocol.


  88      * USENET news.
  89      */
  90     public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(4);
  91 
  92     /**
  93      * USENET news using Network News Transfer Protocol (NNTP).
  94      */
  95     public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(5);
  96 
  97     /**
  98      * Wide Area Information Server (WAIS) protocol.
  99      */
 100     public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(6);
 101 
 102     /**
 103      * Host-specific file names.
 104      */
 105     public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
 106 
 107     /**
 108      * Construct a new reference URI scheme enumeration value with the given
 109      * integer value.
 110      *
 111      * @param  value  Integer value.
 112      */
 113     protected ReferenceUriSchemesSupported(int value) {
 114         super (value);
 115     }
 116 



 117     private static final String[] myStringTable = {
 118         "ftp",
 119         "http",
 120         "https",
 121         "gopher",
 122         "news",
 123         "nntp",
 124         "wais",
 125         "file",
 126     };
 127 




 128     private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
 129         FTP,
 130         HTTP,
 131         HTTPS,
 132         GOPHER,
 133         NEWS,
 134         NNTP,
 135         WAIS,
 136         FILE,
 137     };
 138 
 139     /**
 140      * Returns the string table for class ReferenceUriSchemesSupported.
 141      */
 142     protected String[] getStringTable() {
 143         return myStringTable.clone();
 144     }
 145 
 146     /**
 147      * Returns the enumeration value table for class
 148      * ReferenceUriSchemesSupported.
 149      */
 150     protected EnumSyntax[] getEnumValueTable() {
 151         return (EnumSyntax[])myEnumValueTable.clone();
 152     }
 153 
 154     /**
 155      * Get the printing attribute class which is to be used as the "category"
 156      * for this printing attribute value.
 157      * <P>
 158      * For class ReferenceUriSchemesSupported and any vendor-defined
 159      * subclasses, the category is class ReferenceUriSchemesSupported itself.

 160      *
 161      * @return  Printing attribute class (category), an instance of class
 162      *          {@link java.lang.Class java.lang.Class}.
 163      */
 164     public final Class<? extends Attribute> getCategory() {
 165         return ReferenceUriSchemesSupported.class;
 166     }
 167 
 168     /**
 169      * Get the name of the category of which this attribute value is an
 170      * instance.
 171      * <P>
 172      * For class ReferenceUriSchemesSupported and any vendor-defined
 173      * subclasses, the category name is
 174      * {@code "reference-uri-schemes-supported"}.
 175      *
 176      * @return  Attribute category name.
 177      */
 178     public final String getName() {
 179         return "reference-uri-schemes-supported";
 180     }
 181 
 182 }
   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.print.attribute.standard;
  27 

  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.EnumSyntax;
  30 
  31 /**
  32  * Class {@code ReferenceUriSchemesSupported} is a printing attribute class an
  33  * enumeration, that indicates a "URI scheme," such as "http:" or "ftp:", that a
  34  * printer can use to retrieve print data stored at a {@code URI} location. If a
  35  * printer supports doc flavors with a print data representation class of
  36  * {@code "java.net.URL"}, the printer uses instances of class
  37  * {@code ReferenceUriSchemesSupported} to advertise the {@code URI} schemes it
  38  * can accept. The acceptable {@code URI} schemes are included as service
  39  * attributes in the lookup service; this lets clients search the for printers
  40  * that can get print data using a certain {@code URI} scheme. The acceptable
  41  * {@code URI} schemes can also be queried using the capability methods in
  42  * interface {@code PrintService}. However, {@code ReferenceUriSchemesSupported}
  43  * attributes are used solely for determining acceptable {@code URI} schemes,
  44  * they are never included in a doc's, print request's, print job's, or print
  45  * service's attribute set.
  46  * <p>
  47  * The Internet Assigned Numbers Authority maintains the
  48  * <a href="http://www.iana.org/assignments/uri-schemes.html">official list of
  49  * URI schemes</a>.
  50  * <p>
  51  * Class {@code ReferenceUriSchemesSupported} defines enumeration values for
  52  * widely used {@code URI} schemes. A printer that supports additional
  53  * {@code URI} schemes can define them in a subclass of class
  54  * {@code ReferenceUriSchemesSupported}.
  55  * <p>
  56  * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
  57  * the IPP attribute name. The enumeration's integer value is the IPP enum
  58  * value. The {@code toString()} method returns the IPP string representation of
  59  * the attribute value.
  60  *
  61  * @author Alan Kaminsky
  62  */
  63 public class ReferenceUriSchemesSupported
  64     extends EnumSyntax implements Attribute {
  65 
  66     /**
  67      * Use serialVersionUID from JDK 1.4 for interoperability.
  68      */
  69     private static final long serialVersionUID = -8989076942813442805L;
  70 
  71     /**
  72      * File Transfer Protocol (FTP).
  73      */
  74     public static final ReferenceUriSchemesSupported FTP =
  75         new ReferenceUriSchemesSupported(0);
  76 
  77     /**
  78      * HyperText Transfer Protocol (HTTP).
  79      */
  80     public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(1);
  81 
  82     /**
  83      * Secure HyperText Transfer Protocol (HTTPS).
  84      */
  85     public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(2);
  86 
  87     /**
  88      * Gopher Protocol.


  93      * USENET news.
  94      */
  95     public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(4);
  96 
  97     /**
  98      * USENET news using Network News Transfer Protocol (NNTP).
  99      */
 100     public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(5);
 101 
 102     /**
 103      * Wide Area Information Server (WAIS) protocol.
 104      */
 105     public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(6);
 106 
 107     /**
 108      * Host-specific file names.
 109      */
 110     public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
 111 
 112     /**
 113      * Construct a new reference {@code URI} scheme enumeration value with the
 114      * given integer value.
 115      *
 116      * @param  value Integer value
 117      */
 118     protected ReferenceUriSchemesSupported(int value) {
 119         super (value);
 120     }
 121 
 122     /**
 123      * The string table for class {@code ReferenceUriSchemesSupported}.
 124      */
 125     private static final String[] myStringTable = {
 126         "ftp",
 127         "http",
 128         "https",
 129         "gopher",
 130         "news",
 131         "nntp",
 132         "wais",
 133         "file",
 134     };
 135 
 136     /**
 137      * The enumeration value table for class
 138      * {@code ReferenceUriSchemesSupported}.
 139      */
 140     private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
 141         FTP,
 142         HTTP,
 143         HTTPS,
 144         GOPHER,
 145         NEWS,
 146         NNTP,
 147         WAIS,
 148         FILE,
 149     };
 150 
 151     /**
 152      * Returns the string table for class {@code ReferenceUriSchemesSupported}.
 153      */
 154     protected String[] getStringTable() {
 155         return myStringTable.clone();
 156     }
 157 
 158     /**
 159      * Returns the enumeration value table for class
 160      * {@code ReferenceUriSchemesSupported}.
 161      */
 162     protected EnumSyntax[] getEnumValueTable() {
 163         return (EnumSyntax[])myEnumValueTable.clone();
 164     }
 165 
 166     /**
 167      * Get the printing attribute class which is to be used as the "category"
 168      * for this printing attribute value.
 169      * <p>
 170      * For class {@code ReferenceUriSchemesSupported} and any vendor-defined
 171      * subclasses, the category is class {@code ReferenceUriSchemesSupported}
 172      * itself.
 173      *
 174      * @return printing attribute class (category), an instance of class
 175      *         {@link Class java.lang.Class}
 176      */
 177     public final Class<? extends Attribute> getCategory() {
 178         return ReferenceUriSchemesSupported.class;
 179     }
 180 
 181     /**
 182      * Get the name of the category of which this attribute value is an
 183      * instance.
 184      * <p>
 185      * For class {@code ReferenceUriSchemesSupported} and any vendor-defined
 186      * subclasses, the category name is
 187      * {@code "reference-uri-schemes-supported"}.
 188      *
 189      * @return attribute category name
 190      */
 191     public final String getName() {
 192         return "reference-uri-schemes-supported";
 193     }

 194 }
< prev index next >