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