jdk/src/share/classes/javax/print/DocFlavor.java
author malenkov
Tue, 29 Oct 2013 17:01:06 +0400
changeset 21278 ef8a3a2a72f2
parent 20451 4cedf4e1560a
child 22260 c9185e010e03
permissions -rw-r--r--
8022746: List of spelling errors in API doc Reviewed-by: alexsch, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 5820
diff changeset
     2
 * Copyright (c) 2000, 2010, 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: 1738
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: 1738
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: 1738
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1738
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1738
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.print;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.ObjectInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.ObjectOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * Class <code>DocFlavor</code> encapsulates an object that specifies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * format in which print data is supplied to a {@link DocPrintJob}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * "Doc" is a short, easy-to-pronounce term that means "a piece of print data."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * The print data format, or "doc flavor", consists of two things:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <B>MIME type.</B> This is a Multipurpose Internet Mail Extensions (MIME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * media type (as defined in <A HREF="http://www.ietf.org/rfc/rfc2045.txt">RFC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * 2045</A> and <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * that specifies how the print data is to be interpreted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * The charset of text data should be the IANA MIME-preferred name, or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * canonical name if no preferred name is specified. Additionally a few
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * historical names supported by earlier versions of the Java platform may
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * be recognized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * See <a href="../../java/lang/package-summary.html#charenc">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * character encodings</a> for more information on the character encodings
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * supported on the Java platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * <B>Representation class name.</B> This specifies the fully-qualified name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * the class of the object from which the actual print data comes, as returned
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
    56
 * by the {@link java.lang.Class#getName() Class.getName()} method.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * (Thus the class name for <CODE>byte[]</CODE> is <CODE>"[B"</CODE>, for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <CODE>char[]</CODE> it is <CODE>"[C"</CODE>.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * A <code>DocPrintJob</code> obtains its print data by means of interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * {@link Doc Doc}. A <code>Doc</code> object lets the <code>DocPrintJob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * determine the doc flavor the client can supply.  A <code>Doc</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * also lets the <code>DocPrintJob</code> obtain an instance of the doc flavor's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * representation class, from which the <code>DocPrintJob</code> then obtains
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * the actual print data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * <HR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <H3>Client Formatted Print Data</H3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * There are two broad categories of print data, client formatted print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * and service formatted print data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * For <B>client formatted print data</B>, the client determines or knows the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * print data format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * For example the client may have a JPEG encoded image, a URL for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * HTML code, or a disk file containing plain text in some encoding,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * possibly obtained from an external source, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * requires a way to describe the data format to the print service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * The doc flavor's representation class is a conduit for the JPS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * <code>DocPrintJob</code> to obtain a sequence of characters or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * bytes from the client. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * doc flavor's MIME type is one of the standard media types telling how to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * interpret the sequence of characters or bytes. For a list of standard media
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * types, see the Internet Assigned Numbers Authority's (IANA's) <A
5604
d5b97d8361d0 6952701: Use http://www.ietf.org/rfc for rfc references in jdk public APIs
sherman
parents: 1738
diff changeset
    86
 * HREF="http://www.iana.org/assignments/media-types/">Media Types
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * Directory</A>. Interface {@link Doc Doc} provides two utility operations,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * {@link Doc#getReaderForText() getReaderForText} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * {@link Doc#getStreamForBytes() getStreamForBytes()}, to help a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * <code>Doc</code> object's client extract client formatted print data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * For client formatted print data, the print data representation class is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * typically one of the following (although other representation classes are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * permitted):
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * Character array (<CODE>char[]</CODE>) -- The print data consists of the
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20451
diff changeset
    98
 * Unicode characters in the array.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * <code>String</code>  --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * The print data consists of the Unicode characters in the string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * Character stream ({@link java.io.Reader java.io.Reader})
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * -- The print data consists of the Unicode characters read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * up to the end-of-stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * Byte array (<CODE>byte[]</CODE>) -- The print data consists of the bytes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * the array. The bytes are encoded in the character set specified by the doc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * flavor's MIME type. If the MIME type does not specify a character set, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 * default character set is US-ASCII.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 * Byte stream ({@link java.io.InputStream java.io.InputStream}) --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * The print data consists of the bytes read from the stream up to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * end-of-stream. The bytes are encoded in the character set specified by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * doc flavor's MIME type. If the MIME type does not specify a character set,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * the default character set is US-ASCII.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * Uniform Resource Locator ({@link java.net.URL URL})
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * -- The print data consists of the bytes read from the URL location.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 * The bytes are encoded in the character set specified by the doc flavor's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * MIME type. If the MIME type does not specify a character set, the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * character set is US-ASCII.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * When the representation class is a URL, the print service itself accesses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 * and downloads the document directly from its URL address, without involving
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 * the client. The service may be some form of network print service which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 * is executing in a different environment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 * This means you should not use a URL print data flavor to print a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 * document at a restricted URL that the client can see but the printer cannot
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 * see. This also means you should not use a URL print data flavor to print a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * document stored in a local file that is not available at a URL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * accessible independently of the client.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * For example, a file that is not served up by an HTTP server or FTP server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 * To print such documents, let the client open an input stream on the URL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 * or file and use an input stream data flavor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * <HR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * <h3>Default and Platform Encodings</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 * For byte print data where the doc flavor's MIME type does not include a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 * <CODE>charset</CODE> parameter, the Java Print Service instance assumes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 * US-ASCII character set by default. This is in accordance with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 * <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>, which says the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 * default character set is US-ASCII. Note that US-ASCII is a subset of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * UTF-8, so in the future this may be widened if a future RFC endorses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 * UTF-8 as the default in a compatible manner.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 * Also note that this is different than the behaviour of the Java runtime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 * when interpreting a stream of bytes as text data. That assumes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 * default encoding for the user's locale. Thus, when spooling a file in local
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 * encoding to a Java Print Service it is important to correctly specify
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 * the encoding. Developers working in the English locales should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 * be particularly conscious of this, as their platform encoding corresponds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
 * to the default mime charset. By this coincidence that particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
 * case may work without specifying the encoding of platform data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
 * Every instance of the Java virtual machine has a default character encoding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
 * determined during virtual-machine startup and typically depends upon the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 * locale and charset being used by the underlying operating system.
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20451
diff changeset
   166
 * In a distributed environment there is no guarantee that two VM share
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 * the same default encoding. Thus clients which want to stream platform
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 * encoded text data from the host platform to a Java Print Service instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
 * must explicitly declare the charset and not rely on defaults.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
 * The preferred form is the official IANA primary name for an encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
 * Applications which stream text data should always specify the charset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
 * in the mime type, which necessitates obtaining the encoding of the host
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
 * platform for data (eg files) stored in that platform's encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
 * A CharSet which corresponds to this and is suitable for use in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
 * mime-type for a DocFlavor can be obtained
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
   177
 * from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 * This may not always be the primary IANA name but is guaranteed to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 * understood by this VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 * For common flavors, the pre-defined *HOST DocFlavors may be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 * See <a href="../../java/lang/package-summary.html#charenc">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 * character encodings</a> for more information on the character encodings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 * supported on the Java platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 * <HR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 * <h3>Recommended DocFlavors</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 * The Java Print Service API does not define any mandatorily supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 * DocFlavors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
 * However, here are some examples of MIME types that a Java Print Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
 * instance might support for client formatted print data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
 * Nested classes inside class DocFlavor declare predefined static
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 * constant DocFlavor objects for these example doc flavors; class DocFlavor's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 * constructor can be used to create an arbitrary doc flavor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 * <LI>Preformatted text
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 *  <TH>MIME-Type</TH><TH>Description</TH>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 * <TD><CODE>"text/plain"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 * <TD>Plain text in the default character set (US-ASCII)</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 * <TD><CODE>"text/plain; charset=<I>xxx</I>"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 * <TD>Plain text in character set <I>xxx</I></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 * <TD><CODE>"text/html"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 * <TD>HyperText Markup Language in the default character set (US-ASCII)</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 * <TD><CODE>"text/html; charset=<I>xxx</I>"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 * <TD>HyperText Markup Language in character set <I>xxx</I></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 * </TABLE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 * In general, preformatted text print data is provided either in a character
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 * oriented representation class (character array, String, Reader) or in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
 * byte oriented representation class (byte array, InputStream, URL).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
 *  <LI>Preformatted page description language (PDL) documents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
 *<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
 * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
 *  <TH>MIME-Type</TH><TH>Description</TH>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
 *<TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
 * <TD><CODE>"application/pdf"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
 * <TD>Portable Document Format document</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 * <TD><CODE>"application/postscript"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
 * <TD>PostScript document</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
 * <TD><CODE>"application/vnd.hp-PCL"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
 * <TD>Printer Control Language document</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
 * </TABLE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
 * In general, preformatted PDL print data is provided in a byte oriented
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
 * representation class (byte array, InputStream, URL).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
 *  <LI>Preformatted images
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
 *<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
 * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
 *  <TH>MIME-Type</TH><TH>Description</TH>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
 * <TD><CODE>"image/gif"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
 * <TD>Graphics Interchange Format image</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
 * <TD><CODE>"image/jpeg"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
 * <TD>Joint Photographic Experts Group image</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
 * <TD><CODE>"image/png"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
 * <TD>Portable Network Graphics image</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
 * </TABLE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
 * In general, preformatted image print data is provided in a byte oriented
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
 * representation class (byte array, InputStream, URL).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
 *  <LI>Preformatted autosense print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
 *   <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
 * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
 *  <TH>MIME-Type</TH><TH>Description</TH>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
 * </TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
 * <TR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
 * <TD><CODE>"application/octet-stream"</CODE></TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
 * <TD>The print data format is unspecified (just an octet stream)</TD>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
 * </TABLE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
 * The printer decides how to interpret the print data; the way this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
 * "autosensing" works is implementation dependent. In general, preformatted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
 * autosense print data is provided in a byte oriented representation class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
 * (byte array, InputStream, URL).
19166
e6cd1eb44237 8022175: Fix doclint warnings in javax.print
prr
parents: 7668
diff changeset
   289
 * </UL>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
 * <HR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
 * <H3>Service Formatted Print Data</H3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
 * For <B>service formatted print data</B>, the Java Print Service instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
 * determines the print data format. The doc flavor's representation class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
 * denotes an interface whose methods the <code>DocPrintJob</code> invokes to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
 * determine the content to be printed -- such as a renderable image
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
 * interface or a Java printable interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
 * The doc flavor's MIME type is the special value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
 * <CODE>"application/x-java-jvm-local-objectref"</CODE> indicating the client
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
 * will supply a reference to a Java object that implements the interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
 * named as the representation class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
 * This MIME type is just a placeholder; what's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
 * important is the print data representation class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
 * For service formatted print data, the print data representation class is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
 * typically one of the following (although other representation classes are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
 * permitted). Nested classes inside class DocFlavor declare predefined static
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
 * constant DocFlavor objects for these example doc flavors; class DocFlavor's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
 * constructor can be used to create an arbitrary doc flavor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
 * Renderable image object -- The client supplies an object that implements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
 * interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
 * {@link java.awt.image.renderable.RenderableImage RenderableImage}. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
 * printer calls methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
 * in that interface to obtain the image to be printed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
 * Printable object -- The client supplies an object that implements interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
 * {@link java.awt.print.Printable Printable}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
 * The printer calls methods in that interface to obtain the pages to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
 * printed, one by one.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
 * For each page, the printer supplies a graphics context, and whatever the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
 * client draws in that graphics context gets printed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
 * Pageable object -- The client supplies an object that implements interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
 * {@link java.awt.print.Pageable Pageable}. The printer calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
 * methods in that interface to obtain the pages to be printed, one by one.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
 * For each page, the printer supplies a graphics context, and whatever
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
 * the client draws in that graphics context gets printed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
 * <HR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
 * <HR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
 * <H3>Pre-defined Doc Flavors</H3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
 * A Java Print Service instance is not <B><I>required</I></B> to support the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
 * following print data formats and print data representation classes.  In
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
 * fact, a developer using this class should <b>never</b> assume that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
 * particular print service supports the document types corresponding to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
 * these pre-defined doc flavors.  Always query the print service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
 * to determine what doc flavors it supports.  However,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
 * developers who have print services that support these doc flavors are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
 * encouraged to refer to the predefined singleton instances created here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
 * Plain text print data provided through a byte stream. Specifically, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
 * following doc flavors are recommended to be supported:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
 * <BR>&#183;&nbsp;&nbsp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
 * <CODE>("text/plain", "java.io.InputStream")</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
 * <BR>&#183;&nbsp;&nbsp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
 * <CODE>("text/plain; charset=us-ascii", "java.io.InputStream")</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
 * <BR>&#183;&nbsp;&nbsp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
 * <CODE>("text/plain; charset=utf-8", "java.io.InputStream")</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
 * Renderable image objects. Specifically, the following doc flavor is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
 * recommended to be supported:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
 * <BR>&#183;&nbsp;&nbsp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
 * <CODE>("application/x-java-jvm-local-objectref", "java.awt.image.renderable.RenderableImage")</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
 * A Java Print Service instance is allowed to support any other doc flavors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
 * (or none) in addition to the above mandatory ones, at the implementation's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
 * choice.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
 * Support for the above doc flavors is desirable so a printing client can rely
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
 * on being able to print on any JPS printer, regardless of which doc flavors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
 * the printer supports. If the printer doesn't support the client's preferred
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
 * doc flavor, the client can at least print plain text, or the client can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
 * convert its data to a renderable image and print the image.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
 * Furthermore, every Java Print Service instance must fulfill these
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
 * requirements for processing plain text print data:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
 * The character pair carriage return-line feed (CR-LF) means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
 * "go to column 1 of the next line."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
 * A carriage return (CR) character standing by itself means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
 * "go to column 1 of the next line."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
 * A line feed (LF) character standing by itself means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
 * "go to column 1 of the next line."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
 * The client must itself perform all plain text print data formatting not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
 * addressed by the above requirements.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
 * <H3>Design Rationale</H3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
 * Class DocFlavor in package javax.print.data is similar to class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
 * {@link java.awt.datatransfer.DataFlavor DataFlavor}. Class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
 * <code>DataFlavor</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
 * is not used in the Java Print Service (JPS) API
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
 * for three reasons which are all rooted in allowing the JPS API to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
 * shared by other print services APIs which may need to run on Java profiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
 * which do not include all of the Java Platform, Standard Edition.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
 * <OL TYPE=1>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
 * The JPS API is designed to be used in Java profiles which do not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
 * AWT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
 * The implementation of class <code>java.awt.datatransfer.DataFlavor</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
 * does not guarantee that equivalent data flavors will have the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
 * serialized representation. DocFlavor does, and can be used in services
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
 * which need this.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
 * <LI>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
 * The implementation of class <code>java.awt.datatransfer.DataFlavor</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
 * includes a human presentable name as part of the serialized representation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
 * This is not appropriate as part of a service matching constraint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
 * </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
 * Class DocFlavor's serialized representation uses the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
 * canonical form of a MIME type string. Thus, two doc flavors with MIME types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
 * that are not identical but that are equivalent (that have the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
 * canonical form) may be considered equal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
 * <LI> The media type, media subtype, and parameters are retained, but all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
 *      comments and whitespace characters are discarded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
 * <LI> The media type, media subtype, and parameter names are converted to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
 *      lowercase.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
 * <LI> The parameter values retain their original case, except a charset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
 *      parameter value for a text media type is converted to lowercase.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
 * <LI> Quote characters surrounding parameter values are removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
 * <LI> Quoting backslash characters inside parameter values are removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
 * <LI> The parameters are arranged in ascending order of parameter name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
 * Class DocFlavor's serialized representation also contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
 * fully-qualified class <I>name</I> of the representation class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
 * (a String object), rather than the representation class itself
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
 * (a Class object). This allows a client to examine the doc flavors a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
 * Java Print Service instance supports without having
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
 * to load the representation classes, which may be problematic for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
 * limited-resource clients.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
 * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
public class DocFlavor implements Serializable, Cloneable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    private static final long serialVersionUID = -4512080796965449721L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * A String representing the host operating system encoding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * This will follow the conventions documented in
5820
4f5e99470724 6967036: Need to fix links with // in Javadoc comments
ohair
parents: 5627
diff changeset
   453
     * <a href="http://www.ietf.org/rfc/rfc2278.txt">
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * <i>RFC&nbsp;2278:&nbsp;IANA Charset Registration Procedures</i></a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * except where historical names are returned for compatibility with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * previous versions of the Java platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * The value returned from method is valid only for the VM which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * returns it, for use in a DocFlavor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * This is the charset for all the "HOST" pre-defined DocFlavors in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * the executing VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
    public static final String hostEncoding;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
        hostEncoding =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
            (String)java.security.AccessController.doPrivileged(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
                  new sun.security.action.GetPropertyAction("file.encoding"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * MIME type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
    private transient MimeType myMimeType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * Representation class name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    private String myClassName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * String value for this doc flavor. Computed when needed and cached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
    private transient String myStringValue = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * Constructs a new doc flavor object from the given MIME type and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * representation class name. The given MIME type is converted into
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * canonical form and stored internally.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @param  mimeType   MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * @param  className  Fully-qualified representation class name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     *     <CODE>className</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
    public DocFlavor(String mimeType, String className) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
        if (className == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
            throw new NullPointerException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
        myMimeType = new MimeType (mimeType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
        myClassName = className;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * Returns this doc flavor object's MIME type string based on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * canonical form. Each parameter value is enclosed in quotes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @return the mime type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
    public String getMimeType() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
        return myMimeType.getMimeType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * Returns this doc flavor object's media type (from the MIME type).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * @return the media type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
    public String getMediaType() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
        return myMimeType.getMediaType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * Returns this doc flavor object's media subtype (from the MIME type).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * @return the media sub-type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
    public String getMediaSubtype() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
        return myMimeType.getMediaSubtype();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * Returns a <code>String</code> representing a MIME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * Mime types may include parameters which are usually optional.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * The charset for text types is a commonly useful example.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * This convenience method will return the value of the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * parameter if one was specified in the mime type for this flavor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * @param paramName the name of the paramater. This name is internally
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * converted to the canonical lower case format before performing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * the match.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * @return String representing a mime parameter, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * null if that parameter is not in the mime type string.
19166
e6cd1eb44237 8022175: Fix doclint warnings in javax.print
prr
parents: 7668
diff changeset
   548
     * @exception NullPointerException if paramName is null.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
    public String getParameter(String paramName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
        return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
            (String)myMimeType.getParameterMap().get(paramName.toLowerCase());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * Returns the name of this doc flavor object's representation class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @return the name of the representation class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    public String getRepresentationClassName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
        return myClassName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * Converts this <code>DocFlavor</code> to a string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * @return  MIME type string based on the canonical form. Each parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     *          value is enclosed in quotes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     *          A "class=" parameter is appended to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     *          MIME type string to indicate the representation class name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
        return getStringValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * Returns a hash code for this doc flavor object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
    public int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
        return getStringValue().hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * Determines if this doc flavor object is equal to the given object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * The two are equal if the given object is not null, is an instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * of <code>DocFlavor</code>, has a MIME type equivalent to this doc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * flavor object's MIME type (that is, the MIME types have the same media
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * type, media subtype, and parameters), and has the same representation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * class name as this doc flavor object. Thus, if two doc flavor objects'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * MIME types are the same except for comments, they are considered equal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * However, two doc flavor objects with MIME types of "text/plain" and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * "text/plain; charset=US-ASCII" are not considered equal, even though
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * they represent the same media type (because the default character
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * set for plain text is US-ASCII).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * @param  obj  Object to test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * @return  True if this doc flavor object equals <CODE>obj</CODE>, false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     *          otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
    public boolean equals(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
        return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
            obj != null &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
            obj instanceof DocFlavor &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
            getStringValue().equals (((DocFlavor) obj).getStringValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * Returns this doc flavor object's string value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    private String getStringValue() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
        if (myStringValue == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
            myStringValue = myMimeType + "; class=\"" + myClassName + "\"";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
        return myStringValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * Write the instance to a stream (ie serialize the object).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
    private void writeObject(ObjectOutputStream s) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
        s.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
        s.writeObject(myMimeType.getMimeType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     * Reconstitute an instance from a stream (that is, deserialize it).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     * @serialData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     * The serialised form of a DocFlavor is the String naming the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * representation class followed by the String representing the canonical
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     * form of the mime type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
    private void readObject(ObjectInputStream s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
        throws ClassNotFoundException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
        s.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
        myMimeType = new MimeType((String)s.readObject());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * Class DocFlavor.BYTE_ARRAY provides predefined static constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * DocFlavor objects for example doc flavors using a byte array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * (<CODE>byte[]</CODE>) as the print data representation class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
    public static class BYTE_ARRAY extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
        private static final long serialVersionUID = -9065578006593857475L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
         * Constructs a new doc flavor with the given MIME type and a print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
         * data representation class name of <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
         * @param  mimeType   MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
         * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
         *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
        public BYTE_ARRAY (String mimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
            super (mimeType, "[B");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
         * Doc flavor with MIME type = <CODE>"text/plain"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
         * encoded in the host platform encoding.
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
   672
         * See {@link DocFlavor#hostEncoding hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
         * Print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
         * <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
        public static final BYTE_ARRAY TEXT_PLAIN_HOST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
            new BYTE_ARRAY ("text/plain; charset="+hostEncoding);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
         * <CODE>"text/plain; charset=utf-8"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
        public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
            new BYTE_ARRAY ("text/plain; charset=utf-8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
         * <CODE>"text/plain; charset=utf-16"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
        public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
            new BYTE_ARRAY ("text/plain; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
         * <CODE>"text/plain; charset=utf-16be"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
         * (big-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
        public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
            new BYTE_ARRAY ("text/plain; charset=utf-16be");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
         * <CODE>"text/plain; charset=utf-16le"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
         * (little-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
        public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
            new BYTE_ARRAY ("text/plain; charset=utf-16le");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
         * <CODE>"text/plain; charset=us-ascii"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
         * <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
        public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
            new BYTE_ARRAY ("text/plain; charset=us-ascii");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
         * Doc flavor with MIME type = <CODE>"text/html"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
         * encoded in the host platform encoding.
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
   731
         * See {@link DocFlavor#hostEncoding hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
         * Print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
         * <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
        public static final BYTE_ARRAY TEXT_HTML_HOST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
            new BYTE_ARRAY ("text/html; charset="+hostEncoding);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
         * <CODE>"text/html; charset=utf-8"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
        public static final BYTE_ARRAY TEXT_HTML_UTF_8 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
            new BYTE_ARRAY ("text/html; charset=utf-8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
         * <CODE>"text/html; charset=utf-16"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
        public static final BYTE_ARRAY TEXT_HTML_UTF_16 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
            new BYTE_ARRAY ("text/html; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
         * <CODE>"text/html; charset=utf-16be"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
         * (big-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
        public static final BYTE_ARRAY TEXT_HTML_UTF_16BE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
            new BYTE_ARRAY ("text/html; charset=utf-16be");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
         * <CODE>"text/html; charset=utf-16le"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
         * (little-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
        public static final BYTE_ARRAY TEXT_HTML_UTF_16LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
            new BYTE_ARRAY ("text/html; charset=utf-16le");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
         * <CODE>"text/html; charset=us-ascii"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
         * <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
        public static final BYTE_ARRAY TEXT_HTML_US_ASCII =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
            new BYTE_ARRAY ("text/html; charset=us-ascii");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
         * Doc flavor with MIME type = <CODE>"application/pdf"</CODE>, print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
         * data representation class name = <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
        public static final BYTE_ARRAY PDF = new BYTE_ARRAY ("application/pdf");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
         * Doc flavor with MIME type = <CODE>"application/postscript"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
        public static final BYTE_ARRAY POSTSCRIPT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
            new BYTE_ARRAY ("application/postscript");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
         * Doc flavor with MIME type = <CODE>"application/vnd.hp-PCL"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
         * array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
        public static final BYTE_ARRAY PCL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
            new BYTE_ARRAY ("application/vnd.hp-PCL");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
         * Doc flavor with MIME type = <CODE>"image/gif"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
         * representation class name = <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
        public static final BYTE_ARRAY GIF = new BYTE_ARRAY ("image/gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
         * Doc flavor with MIME type = <CODE>"image/jpeg"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
         * representation class name = <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
        public static final BYTE_ARRAY JPEG = new BYTE_ARRAY ("image/jpeg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
         * Doc flavor with MIME type = <CODE>"image/png"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
         * representation class name = <CODE>"[B"</CODE> (byte array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
        public static final BYTE_ARRAY PNG = new BYTE_ARRAY ("image/png");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
         * <CODE>"application/octet-stream"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
         * print data representation class name = <CODE>"[B"</CODE> (byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
         * array). The client must determine that data described
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
         * using this DocFlavor is valid for the printer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
        public static final BYTE_ARRAY AUTOSENSE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
            new BYTE_ARRAY ("application/octet-stream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * Class DocFlavor.INPUT_STREAM provides predefined static constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * DocFlavor objects for example doc flavors using a byte stream ({@link
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
   841
     * java.io.InputStream java.io.InputStream}) as the print
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     * data representation class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
    public static class INPUT_STREAM extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
        private static final long serialVersionUID = -7045842700749194127L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
         * Constructs a new doc flavor with the given MIME type and a print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
         * data representation class name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
         * @param  mimeType   MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
         * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
         *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
        public INPUT_STREAM (String mimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
            super (mimeType, "java.io.InputStream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
         * Doc flavor with MIME type = <CODE>"text/plain"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
         * encoded in the host platform encoding.
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
   871
         * See {@link DocFlavor#hostEncoding hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
         * Print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
        public static final INPUT_STREAM TEXT_PLAIN_HOST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
            new INPUT_STREAM ("text/plain; charset="+hostEncoding);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
         * <CODE>"text/plain; charset=utf-8"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
        public static final INPUT_STREAM TEXT_PLAIN_UTF_8 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
            new INPUT_STREAM ("text/plain; charset=utf-8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
         * <CODE>"text/plain; charset=utf-16"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
        public static final INPUT_STREAM TEXT_PLAIN_UTF_16 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
            new INPUT_STREAM ("text/plain; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
         * <CODE>"text/plain; charset=utf-16be"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
         * (big-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
        public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
            new INPUT_STREAM ("text/plain; charset=utf-16be");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
         * <CODE>"text/plain; charset=utf-16le"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
         * (little-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
        public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
            new INPUT_STREAM ("text/plain; charset=utf-16le");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
         * <CODE>"text/plain; charset=us-ascii"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
        public static final INPUT_STREAM TEXT_PLAIN_US_ASCII =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
                new INPUT_STREAM ("text/plain; charset=us-ascii");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
         * Doc flavor with MIME type = <CODE>"text/html"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
         * encoded in the host platform encoding.
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
   928
         * See {@link DocFlavor#hostEncoding hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
         * Print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
        public static final INPUT_STREAM TEXT_HTML_HOST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
            new INPUT_STREAM ("text/html; charset="+hostEncoding);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
         * <CODE>"text/html; charset=utf-8"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
        public static final INPUT_STREAM TEXT_HTML_UTF_8 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
            new INPUT_STREAM ("text/html; charset=utf-8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
         * <CODE>"text/html; charset=utf-16"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
        public static final INPUT_STREAM TEXT_HTML_UTF_16 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
            new INPUT_STREAM ("text/html; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
         * <CODE>"text/html; charset=utf-16be"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
         * (big-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
        public static final INPUT_STREAM TEXT_HTML_UTF_16BE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
            new INPUT_STREAM ("text/html; charset=utf-16be");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
         * <CODE>"text/html; charset=utf-16le"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
         * (little-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
        public static final INPUT_STREAM TEXT_HTML_UTF_16LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
            new INPUT_STREAM ("text/html; charset=utf-16le");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
         * <CODE>"text/html; charset=us-ascii"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
        public static final INPUT_STREAM TEXT_HTML_US_ASCII =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
            new INPUT_STREAM ("text/html; charset=us-ascii");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
         * Doc flavor with MIME type = <CODE>"application/pdf"</CODE>, print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
         * data representation class name = <CODE>"java.io.InputStream"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
         * (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
        public static final INPUT_STREAM PDF = new INPUT_STREAM ("application/pdf");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
         * Doc flavor with MIME type = <CODE>"application/postscript"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
        public static final INPUT_STREAM POSTSCRIPT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
            new INPUT_STREAM ("application/postscript");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
         * Doc flavor with MIME type = <CODE>"application/vnd.hp-PCL"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
        public static final INPUT_STREAM PCL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
            new INPUT_STREAM ("application/vnd.hp-PCL");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
         * Doc flavor with MIME type = <CODE>"image/gif"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
         * representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
        public static final INPUT_STREAM GIF = new INPUT_STREAM ("image/gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
         * Doc flavor with MIME type = <CODE>"image/jpeg"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
         * representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
        public static final INPUT_STREAM JPEG = new INPUT_STREAM ("image/jpeg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
         * Doc flavor with MIME type = <CODE>"image/png"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
         * representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
        public static final INPUT_STREAM PNG = new INPUT_STREAM ("image/png");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
         * <CODE>"application/octet-stream"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
         * <CODE>"java.io.InputStream"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
         * The client must determine that data described
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
         * using this DocFlavor is valid for the printer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
        public static final INPUT_STREAM AUTOSENSE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
            new INPUT_STREAM ("application/octet-stream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     * Class DocFlavor.URL provides predefined static constant DocFlavor
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
     * objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
     * For example doc flavors using a Uniform Resource Locator ({@link
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
  1044
     * java.net.URL java.net.URL}) as the print data
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * representation  class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
    public static class URL extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
         * Constructs a new doc flavor with the given MIME type and a print
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
         * data representation class name of <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
         * @param  mimeType   MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
         * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
         *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
        public URL (String mimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
            super (mimeType, "java.net.URL");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
         * Doc flavor with MIME type = <CODE>"text/plain"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
         * encoded in the host platform encoding.
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
  1071
         * See {@link DocFlavor#hostEncoding hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
         * Print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
        public static final URL TEXT_PLAIN_HOST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
            new URL ("text/plain; charset="+hostEncoding);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
         * <CODE>"text/plain; charset=utf-8"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
        public static final URL TEXT_PLAIN_UTF_8 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
            new URL ("text/plain; charset=utf-8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
         * <CODE>"text/plain; charset=utf-16"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
         * <CODE>java.net.URL""</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
        public static final URL TEXT_PLAIN_UTF_16 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
            new URL ("text/plain; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
         * <CODE>"text/plain; charset=utf-16be"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
         * (big-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
        public static final URL TEXT_PLAIN_UTF_16BE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
            new URL ("text/plain; charset=utf-16be");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
         * <CODE>"text/plain; charset=utf-16le"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
         * (little-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
        public static final URL TEXT_PLAIN_UTF_16LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
            new URL ("text/plain; charset=utf-16le");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
         * <CODE>"text/plain; charset=us-ascii"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
        public static final URL TEXT_PLAIN_US_ASCII =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
            new URL ("text/plain; charset=us-ascii");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
         * Doc flavor with MIME type = <CODE>"text/html"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
         * encoded in the host platform encoding.
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
  1128
         * See {@link DocFlavor#hostEncoding hostEncoding}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
         * Print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
        public static final URL TEXT_HTML_HOST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
            new URL ("text/html; charset="+hostEncoding);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
         * <CODE>"text/html; charset=utf-8"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
        public static final URL TEXT_HTML_UTF_8 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
            new URL ("text/html; charset=utf-8");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
         * <CODE>"text/html; charset=utf-16"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
        public static final URL TEXT_HTML_UTF_16 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
            new URL ("text/html; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
         * <CODE>"text/html; charset=utf-16be"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
         * (big-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
        public static final URL TEXT_HTML_UTF_16BE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
            new URL ("text/html; charset=utf-16be");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
         * <CODE>"text/html; charset=utf-16le"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
         * (little-endian byte ordering),
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
        public static final URL TEXT_HTML_UTF_16LE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
            new URL ("text/html; charset=utf-16le");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
         * <CODE>"text/html; charset=us-ascii"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
         * print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
         * <CODE>"java.net.URL"</CODE> (byte stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
        public static final URL TEXT_HTML_US_ASCII =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
            new URL ("text/html; charset=us-ascii");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
         * Doc flavor with MIME type = <CODE>"application/pdf"</CODE>, print
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
         * data representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
        public static final URL PDF = new URL ("application/pdf");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
         * Doc flavor with MIME type = <CODE>"application/postscript"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
         * print data representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
        public static final URL POSTSCRIPT = new URL ("application/postscript");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
         * Doc flavor with MIME type = <CODE>"application/vnd.hp-PCL"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
         * print data representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
        public static final URL PCL = new URL ("application/vnd.hp-PCL");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
         * Doc flavor with MIME type = <CODE>"image/gif"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
         * representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
        public static final URL GIF = new URL ("image/gif");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
         * Doc flavor with MIME type = <CODE>"image/jpeg"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
         * representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
        public static final URL JPEG = new URL ("image/jpeg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
         * Doc flavor with MIME type = <CODE>"image/png"</CODE>, print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
         * representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
        public static final URL PNG = new URL ("image/png");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
         * Doc flavor with MIME type =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
         * <CODE>"application/octet-stream"</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
         * print data representation class name = <CODE>"java.net.URL"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
         *  The client must determine that data described
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
         * using this DocFlavor is valid for the printer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
        public static final URL AUTOSENSE = new URL ("application/octet-stream");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
     * Class DocFlavor.CHAR_ARRAY provides predefined static constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
     * DocFlavor objects for example doc flavors using a character array
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
     * (<CODE>char[]</CODE>) as the print data representation class. As such,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
     * the character set is Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
    public static class CHAR_ARRAY extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
        private static final long serialVersionUID = -8720590903724405128L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
         * Constructs a new doc flavor with the given MIME type and a print
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
         * data representation class name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
         * <CODE>"[C"</CODE> (character array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
         * @param  mimeType  MIME media type string. If it is a text media
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
         *                      type, it is assumed to contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
         *                      <CODE>"charset=utf-16"</CODE> parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
         * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
         *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
        public CHAR_ARRAY (String mimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
            super (mimeType, "[C");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
         * Doc flavor with MIME type = <CODE>"text/plain;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
         * charset=utf-16"</CODE>, print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
         * <CODE>"[C"</CODE> (character array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
        public static final CHAR_ARRAY TEXT_PLAIN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
            new CHAR_ARRAY ("text/plain; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
         * Doc flavor with MIME type = <CODE>"text/html;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
         * charset=utf-16"</CODE>, print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
         * <CODE>"[C"</CODE> (character array).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
        public static final CHAR_ARRAY TEXT_HTML =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
            new CHAR_ARRAY ("text/html; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
     * Class DocFlavor.STRING provides predefined static constant DocFlavor
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
     * objects for example doc flavors using a string ({@link java.lang.String
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
  1283
     * java.lang.String}) as the print data representation class.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
     * As such, the character set is Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
    public static class STRING extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
        private static final long serialVersionUID = 4414407504887034035L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
         * Constructs a new doc flavor with the given MIME type and a print
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
         * data representation class name of <CODE>"java.lang.String"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
         * @param  mimeType  MIME media type string. If it is a text media
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
         *                      type, it is assumed to contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
         *                      <CODE>"charset=utf-16"</CODE> parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
         * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
         *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
        public STRING (String mimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
            super (mimeType, "java.lang.String");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
         * Doc flavor with MIME type = <CODE>"text/plain;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
         * charset=utf-16"</CODE>, print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
         * <CODE>"java.lang.String"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
        public static final STRING TEXT_PLAIN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
            new STRING ("text/plain; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
         * Doc flavor with MIME type = <CODE>"text/html;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
         * charset=utf-16"</CODE>, print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
         * <CODE>"java.lang.String"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
        public static final STRING TEXT_HTML =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
            new STRING ("text/html; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
     * Class DocFlavor.READER provides predefined static constant DocFlavor
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
     * objects for example doc flavors using a character stream ({@link
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 19166
diff changeset
  1331
     * java.io.Reader java.io.Reader}) as the print data
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
     * representation class. As such, the character set is Unicode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
    public static class READER extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
        private static final long serialVersionUID = 7100295812579351567L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
         * Constructs a new doc flavor with the given MIME type and a print
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
         * data representation class name of\
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
         * <CODE>"java.io.Reader"</CODE> (character stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
         * @param  mimeType  MIME media type string. If it is a text media
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
         *                      type, it is assumed to contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
         *                      <CODE>"charset=utf-16"</CODE> parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
         * @exception  IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
         *     (unchecked exception) Thrown if <CODE>mimeType</CODE> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
         *     obey the syntax for a MIME media type string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
        public READER (String mimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
            super (mimeType, "java.io.Reader");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
         * Doc flavor with MIME type = <CODE>"text/plain;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
         * charset=utf-16"</CODE>, print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
         * <CODE>"java.io.Reader"</CODE> (character stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
        public static final READER TEXT_PLAIN =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
            new READER ("text/plain; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
         * Doc flavor with MIME type = <CODE>"text/html;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
         * charset=utf-16"</CODE>, print data representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
         * <CODE>"java.io.Reader"</CODE> (character stream).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
        public static final READER TEXT_HTML =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
            new READER ("text/html; charset=utf-16");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
     * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
     * DocFlavor objects for example doc flavors for service formatted print
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
     * data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
     * @author  Alan Kaminsky
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
    public static class SERVICE_FORMATTED extends DocFlavor {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
        private static final long serialVersionUID = 6181337766266637256L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
         * Constructs a new doc flavor with a MIME type of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
         * <CODE>"application/x-java-jvm-local-objectref"</CODE> indicating
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
         * service formatted print data and the given print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
         * representation class name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
         * @param  className  Fully-qualified representation class name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
         * @exception  NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
         *     (unchecked exception) Thrown if <CODE>className</CODE> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
         *     null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
        public SERVICE_FORMATTED (String className) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
            super ("application/x-java-jvm-local-objectref", className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
         * Service formatted print data doc flavor with print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
         * representation class name =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
         * <CODE>"java.awt.image.renderable.RenderableImage"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
         * (renderable image object).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
        public static final SERVICE_FORMATTED RENDERABLE_IMAGE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
            new SERVICE_FORMATTED("java.awt.image.renderable.RenderableImage");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
         * Service formatted print data doc flavor with print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
         * representation class name = <CODE>"java.awt.print.Printable"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
         * (printable object).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
        public static final SERVICE_FORMATTED PRINTABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
            new SERVICE_FORMATTED ("java.awt.print.Printable");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
         * Service formatted print data doc flavor with print data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
         * representation class name = <CODE>"java.awt.print.Pageable"</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
         * (pageable object).
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
        public static final SERVICE_FORMATTED PAGEABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
            new SERVICE_FORMATTED ("java.awt.print.Pageable");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
}