Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/DocFlavor.java
38829 views
/*1* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.print;2627import java.io.IOException;28import java.io.ObjectInputStream;29import java.io.ObjectOutputStream;30import java.io.Serializable;313233/**34* Class <code>DocFlavor</code> encapsulates an object that specifies the35* format in which print data is supplied to a {@link DocPrintJob}.36* "Doc" is a short, easy-to-pronounce term that means "a piece of print data."37* The print data format, or "doc flavor", consists of two things:38* <UL>39* <LI>40* <B>MIME type.</B> This is a Multipurpose Internet Mail Extensions (MIME)41* media type (as defined in <A HREF="http://www.ietf.org/rfc/rfc2045.txt">RFC42* 2045</A> and <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>)43* that specifies how the print data is to be interpreted.44* The charset of text data should be the IANA MIME-preferred name, or its45* canonical name if no preferred name is specified. Additionally a few46* historical names supported by earlier versions of the Java platform may47* be recognized.48* See <a href="../../java/lang/package-summary.html#charenc">49* character encodings</a> for more information on the character encodings50* supported on the Java platform.51* <P>52* <LI>53* <B>Representation class name.</B> This specifies the fully-qualified name of54* the class of the object from which the actual print data comes, as returned55* by the {@link java.lang.Class#getName() Class.getName()} method.56* (Thus the class name for <CODE>byte[]</CODE> is <CODE>"[B"</CODE>, for57* <CODE>char[]</CODE> it is <CODE>"[C"</CODE>.)58* </UL>59* <P>60* A <code>DocPrintJob</code> obtains its print data by means of interface61* {@link Doc Doc}. A <code>Doc</code> object lets the <code>DocPrintJob</code>62* determine the doc flavor the client can supply. A <code>Doc</code> object63* also lets the <code>DocPrintJob</code> obtain an instance of the doc flavor's64* representation class, from which the <code>DocPrintJob</code> then obtains65* the actual print data.66* <P>67* <HR>68* <H3>Client Formatted Print Data</H3>69* There are two broad categories of print data, client formatted print data70* and service formatted print data.71* <P>72* For <B>client formatted print data</B>, the client determines or knows the73* print data format.74* For example the client may have a JPEG encoded image, a URL for75* HTML code, or a disk file containing plain text in some encoding,76* possibly obtained from an external source, and77* requires a way to describe the data format to the print service.78* <p>79* The doc flavor's representation class is a conduit for the JPS80* <code>DocPrintJob</code> to obtain a sequence of characters or81* bytes from the client. The82* doc flavor's MIME type is one of the standard media types telling how to83* interpret the sequence of characters or bytes. For a list of standard media84* types, see the Internet Assigned Numbers Authority's (IANA's) <A85* HREF="http://www.iana.org/assignments/media-types/">Media Types86* Directory</A>. Interface {@link Doc Doc} provides two utility operations,87* {@link Doc#getReaderForText() getReaderForText} and88* {@link Doc#getStreamForBytes() getStreamForBytes()}, to help a89* <code>Doc</code> object's client extract client formatted print data.90* <P>91* For client formatted print data, the print data representation class is92* typically one of the following (although other representation classes are93* permitted):94* <UL>95* <LI>96* Character array (<CODE>char[]</CODE>) -- The print data consists of the97* Unicode characters in the array.98* <P>99* <LI>100* <code>String</code> --101* The print data consists of the Unicode characters in the string.102* <P>103* <LI>104* Character stream ({@link java.io.Reader java.io.Reader})105* -- The print data consists of the Unicode characters read from the stream106* up to the end-of-stream.107* <P>108* <LI>109* Byte array (<CODE>byte[]</CODE>) -- The print data consists of the bytes in110* the array. The bytes are encoded in the character set specified by the doc111* flavor's MIME type. If the MIME type does not specify a character set, the112* default character set is US-ASCII.113* <P>114* <LI>115* Byte stream ({@link java.io.InputStream java.io.InputStream}) --116* The print data consists of the bytes read from the stream up to the117* end-of-stream. The bytes are encoded in the character set specified by the118* doc flavor's MIME type. If the MIME type does not specify a character set,119* the default character set is US-ASCII.120121* <LI>122* Uniform Resource Locator ({@link java.net.URL URL})123* -- The print data consists of the bytes read from the URL location.124* The bytes are encoded in the character set specified by the doc flavor's125* MIME type. If the MIME type does not specify a character set, the default126* character set is US-ASCII.127* <P>128* When the representation class is a URL, the print service itself accesses129* and downloads the document directly from its URL address, without involving130* the client. The service may be some form of network print service which131* is executing in a different environment.132* This means you should not use a URL print data flavor to print a133* document at a restricted URL that the client can see but the printer cannot134* see. This also means you should not use a URL print data flavor to print a135* document stored in a local file that is not available at a URL136* accessible independently of the client.137* For example, a file that is not served up by an HTTP server or FTP server.138* To print such documents, let the client open an input stream on the URL139* or file and use an input stream data flavor.140* </UL>141* <p>142* <HR>143* <h3>Default and Platform Encodings</h3>144* <P>145* For byte print data where the doc flavor's MIME type does not include a146* <CODE>charset</CODE> parameter, the Java Print Service instance assumes the147* US-ASCII character set by default. This is in accordance with148* <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>, which says the149* default character set is US-ASCII. Note that US-ASCII is a subset of150* UTF-8, so in the future this may be widened if a future RFC endorses151* UTF-8 as the default in a compatible manner.152* <p>153* Also note that this is different than the behaviour of the Java runtime154* when interpreting a stream of bytes as text data. That assumes the155* default encoding for the user's locale. Thus, when spooling a file in local156* encoding to a Java Print Service it is important to correctly specify157* the encoding. Developers working in the English locales should158* be particularly conscious of this, as their platform encoding corresponds159* to the default mime charset. By this coincidence that particular160* case may work without specifying the encoding of platform data.161* <p>162* Every instance of the Java virtual machine has a default character encoding163* determined during virtual-machine startup and typically depends upon the164* locale and charset being used by the underlying operating system.165* In a distributed environment there is no guarantee that two VM share166* the same default encoding. Thus clients which want to stream platform167* encoded text data from the host platform to a Java Print Service instance168* must explicitly declare the charset and not rely on defaults.169* <p>170* The preferred form is the official IANA primary name for an encoding.171* Applications which stream text data should always specify the charset172* in the mime type, which necessitates obtaining the encoding of the host173* platform for data (eg files) stored in that platform's encoding.174* A CharSet which corresponds to this and is suitable for use in a175* mime-type for a DocFlavor can be obtained176* from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding}177* This may not always be the primary IANA name but is guaranteed to be178* understood by this VM.179* For common flavors, the pre-defined *HOST DocFlavors may be used.180* <p>181* <p>182* See <a href="../../java/lang/package-summary.html#charenc">183* character encodings</a> for more information on the character encodings184* supported on the Java platform.185* <p>186* <HR>187* <h3>Recommended DocFlavors</h3>188* <P>189* The Java Print Service API does not define any mandatorily supported190* DocFlavors.191* However, here are some examples of MIME types that a Java Print Service192* instance might support for client formatted print data.193* Nested classes inside class DocFlavor declare predefined static194* constant DocFlavor objects for these example doc flavors; class DocFlavor's195* constructor can be used to create an arbitrary doc flavor.196* <UL>197* <LI>Preformatted text198* <P>199* <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">200* <TR>201* <TH>MIME-Type</TH><TH>Description</TH>202* </TR>203* <TR>204* <TD><CODE>"text/plain"</CODE></TD>205* <TD>Plain text in the default character set (US-ASCII)</TD>206* </TR>207* <TR>208* <TD><CODE>"text/plain; charset=<I>xxx</I>"</CODE></TD>209* <TD>Plain text in character set <I>xxx</I></TD>210* </TR>211* <TR>212* <TD><CODE>"text/html"</CODE></TD>213* <TD>HyperText Markup Language in the default character set (US-ASCII)</TD>214* </TR>215* <TR>216* <TD><CODE>"text/html; charset=<I>xxx</I>"</CODE></TD>217* <TD>HyperText Markup Language in character set <I>xxx</I></TD>218* </TR>219* </TABLE>220* <P>221* In general, preformatted text print data is provided either in a character222* oriented representation class (character array, String, Reader) or in a223* byte oriented representation class (byte array, InputStream, URL).224* <P>225* <LI>Preformatted page description language (PDL) documents226*<P>227* <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">228* <TR>229* <TH>MIME-Type</TH><TH>Description</TH>230* </TR>231*<TR>232* <TD><CODE>"application/pdf"</CODE></TD>233* <TD>Portable Document Format document</TD>234* </TR>235* <TR>236* <TD><CODE>"application/postscript"</CODE></TD>237* <TD>PostScript document</TD>238* </TR>239* <TR>240* <TD><CODE>"application/vnd.hp-PCL"</CODE></TD>241* <TD>Printer Control Language document</TD>242* </TR>243* </TABLE>244* <P>245* In general, preformatted PDL print data is provided in a byte oriented246* representation class (byte array, InputStream, URL).247* <P>248* <LI>Preformatted images249*<P>250* <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">251* <TR>252* <TH>MIME-Type</TH><TH>Description</TH>253* </TR>254*255* <TR>256* <TD><CODE>"image/gif"</CODE></TD>257* <TD>Graphics Interchange Format image</TD>258* </TR>259* <TR>260* <TD><CODE>"image/jpeg"</CODE></TD>261* <TD>Joint Photographic Experts Group image</TD>262* </TR>263* <TR>264* <TD><CODE>"image/png"</CODE></TD>265* <TD>Portable Network Graphics image</TD>266* </TR>267* </TABLE>268* <P>269* In general, preformatted image print data is provided in a byte oriented270* representation class (byte array, InputStream, URL).271* <P>272* <LI>Preformatted autosense print data273* <P>274* <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">275* <TR>276* <TH>MIME-Type</TH><TH>Description</TH>277* </TR>278*279* <TR>280* <TD><CODE>"application/octet-stream"</CODE></TD>281* <TD>The print data format is unspecified (just an octet stream)</TD>282* </TABLE>283* <P>284* The printer decides how to interpret the print data; the way this285* "autosensing" works is implementation dependent. In general, preformatted286* autosense print data is provided in a byte oriented representation class287* (byte array, InputStream, URL).288* </UL>289* <P>290* <HR>291* <H3>Service Formatted Print Data</H3>292* <P>293* For <B>service formatted print data</B>, the Java Print Service instance294* determines the print data format. The doc flavor's representation class295* denotes an interface whose methods the <code>DocPrintJob</code> invokes to296* determine the content to be printed -- such as a renderable image297* interface or a Java printable interface.298* The doc flavor's MIME type is the special value299* <CODE>"application/x-java-jvm-local-objectref"</CODE> indicating the client300* will supply a reference to a Java object that implements the interface301* named as the representation class.302* This MIME type is just a placeholder; what's303* important is the print data representation class.304* <P>305* For service formatted print data, the print data representation class is306* typically one of the following (although other representation classes are307* permitted). Nested classes inside class DocFlavor declare predefined static308* constant DocFlavor objects for these example doc flavors; class DocFlavor's309* constructor can be used to create an arbitrary doc flavor.310* <UL>311* <LI>312* Renderable image object -- The client supplies an object that implements313* interface314* {@link java.awt.image.renderable.RenderableImage RenderableImage}. The315* printer calls methods316* in that interface to obtain the image to be printed.317* <P>318* <LI>319* Printable object -- The client supplies an object that implements interface320* {@link java.awt.print.Printable Printable}.321* The printer calls methods in that interface to obtain the pages to be322* printed, one by one.323* For each page, the printer supplies a graphics context, and whatever the324* client draws in that graphics context gets printed.325* <P>326* <LI>327* Pageable object -- The client supplies an object that implements interface328* {@link java.awt.print.Pageable Pageable}. The printer calls329* methods in that interface to obtain the pages to be printed, one by one.330* For each page, the printer supplies a graphics context, and whatever331* the client draws in that graphics context gets printed.332* </UL>333* <P>334* <HR>335* <P>336* <HR>337* <H3>Pre-defined Doc Flavors</H3>338* A Java Print Service instance is not <B><I>required</I></B> to support the339* following print data formats and print data representation classes. In340* fact, a developer using this class should <b>never</b> assume that a341* particular print service supports the document types corresponding to342* these pre-defined doc flavors. Always query the print service343* to determine what doc flavors it supports. However,344* developers who have print services that support these doc flavors are345* encouraged to refer to the predefined singleton instances created here.346* <UL>347* <LI>348* Plain text print data provided through a byte stream. Specifically, the349* following doc flavors are recommended to be supported:350* <BR>· 351* <CODE>("text/plain", "java.io.InputStream")</CODE>352* <BR>· 353* <CODE>("text/plain; charset=us-ascii", "java.io.InputStream")</CODE>354* <BR>· 355* <CODE>("text/plain; charset=utf-8", "java.io.InputStream")</CODE>356* <P>357* <LI>358* Renderable image objects. Specifically, the following doc flavor is359* recommended to be supported:360* <BR>· 361* <CODE>("application/x-java-jvm-local-objectref", "java.awt.image.renderable.RenderableImage")</CODE>362* </UL>363* <P>364* A Java Print Service instance is allowed to support any other doc flavors365* (or none) in addition to the above mandatory ones, at the implementation's366* choice.367* <P>368* Support for the above doc flavors is desirable so a printing client can rely369* on being able to print on any JPS printer, regardless of which doc flavors370* the printer supports. If the printer doesn't support the client's preferred371* doc flavor, the client can at least print plain text, or the client can372* convert its data to a renderable image and print the image.373* <P>374* Furthermore, every Java Print Service instance must fulfill these375* requirements for processing plain text print data:376* <UL>377* <LI>378* The character pair carriage return-line feed (CR-LF) means379* "go to column 1 of the next line."380* <LI>381* A carriage return (CR) character standing by itself means382* "go to column 1 of the next line."383* <LI>384* A line feed (LF) character standing by itself means385* "go to column 1 of the next line."386* <LI>387* </UL>388* <P>389* The client must itself perform all plain text print data formatting not390* addressed by the above requirements.391* <P>392* <H3>Design Rationale</H3>393* <P>394* Class DocFlavor in package javax.print.data is similar to class395* {@link java.awt.datatransfer.DataFlavor DataFlavor}. Class396* <code>DataFlavor</code>397* is not used in the Java Print Service (JPS) API398* for three reasons which are all rooted in allowing the JPS API to be399* shared by other print services APIs which may need to run on Java profiles400* which do not include all of the Java Platform, Standard Edition.401* <OL TYPE=1>402* <LI>403* The JPS API is designed to be used in Java profiles which do not support404* AWT.405* <P>406* <LI>407* The implementation of class <code>java.awt.datatransfer.DataFlavor</code>408* does not guarantee that equivalent data flavors will have the same409* serialized representation. DocFlavor does, and can be used in services410* which need this.411* <P>412* <LI>413* The implementation of class <code>java.awt.datatransfer.DataFlavor</code>414* includes a human presentable name as part of the serialized representation.415* This is not appropriate as part of a service matching constraint.416* </OL>417* <P>418* Class DocFlavor's serialized representation uses the following419* canonical form of a MIME type string. Thus, two doc flavors with MIME types420* that are not identical but that are equivalent (that have the same421* canonical form) may be considered equal.422* <UL>423* <LI> The media type, media subtype, and parameters are retained, but all424* comments and whitespace characters are discarded.425* <LI> The media type, media subtype, and parameter names are converted to426* lowercase.427* <LI> The parameter values retain their original case, except a charset428* parameter value for a text media type is converted to lowercase.429* <LI> Quote characters surrounding parameter values are removed.430* <LI> Quoting backslash characters inside parameter values are removed.431* <LI> The parameters are arranged in ascending order of parameter name.432* </UL>433* <P>434* Class DocFlavor's serialized representation also contains the435* fully-qualified class <I>name</I> of the representation class436* (a String object), rather than the representation class itself437* (a Class object). This allows a client to examine the doc flavors a438* Java Print Service instance supports without having439* to load the representation classes, which may be problematic for440* limited-resource clients.441* <P>442*443* @author Alan Kaminsky444*/445public class DocFlavor implements Serializable, Cloneable {446447private static final long serialVersionUID = -4512080796965449721L;448449/**450* A String representing the host operating system encoding.451* This will follow the conventions documented in452* <a href="http://www.ietf.org/rfc/rfc2278.txt">453* <i>RFC 2278: IANA Charset Registration Procedures</i></a>454* except where historical names are returned for compatibility with455* previous versions of the Java platform.456* The value returned from method is valid only for the VM which457* returns it, for use in a DocFlavor.458* This is the charset for all the "HOST" pre-defined DocFlavors in459* the executing VM.460*/461public static final String hostEncoding;462463static {464hostEncoding =465(String)java.security.AccessController.doPrivileged(466new sun.security.action.GetPropertyAction("file.encoding"));467}468469/**470* MIME type.471*/472private transient MimeType myMimeType;473474/**475* Representation class name.476* @serial477*/478private String myClassName;479480/**481* String value for this doc flavor. Computed when needed and cached.482*/483private transient String myStringValue = null;484485486/**487* Constructs a new doc flavor object from the given MIME type and488* representation class name. The given MIME type is converted into489* canonical form and stored internally.490*491* @param mimeType MIME media type string.492* @param className Fully-qualified representation class name.493*494* @exception NullPointerException495* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null or496* <CODE>className</CODE> is null.497* @exception IllegalArgumentException498* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not499* obey the syntax for a MIME media type string.500*/501public DocFlavor(String mimeType, String className) {502if (className == null) {503throw new NullPointerException();504}505myMimeType = new MimeType (mimeType);506myClassName = className;507}508509/**510* Returns this doc flavor object's MIME type string based on the511* canonical form. Each parameter value is enclosed in quotes.512* @return the mime type513*/514public String getMimeType() {515return myMimeType.getMimeType();516}517518/**519* Returns this doc flavor object's media type (from the MIME type).520* @return the media type521*/522public String getMediaType() {523return myMimeType.getMediaType();524}525526/**527* Returns this doc flavor object's media subtype (from the MIME type).528* @return the media sub-type529*/530public String getMediaSubtype() {531return myMimeType.getMediaSubtype();532}533534/**535* Returns a <code>String</code> representing a MIME536* parameter.537* Mime types may include parameters which are usually optional.538* The charset for text types is a commonly useful example.539* This convenience method will return the value of the specified540* parameter if one was specified in the mime type for this flavor.541* <p>542* @param paramName the name of the paramater. This name is internally543* converted to the canonical lower case format before performing544* the match.545* @return String representing a mime parameter, or546* null if that parameter is not in the mime type string.547* @exception NullPointerException if paramName is null.548*/549public String getParameter(String paramName) {550return551(String)myMimeType.getParameterMap().get(paramName.toLowerCase());552}553554/**555* Returns the name of this doc flavor object's representation class.556* @return the name of the representation class.557*/558public String getRepresentationClassName() {559return myClassName;560}561562/**563* Converts this <code>DocFlavor</code> to a string.564*565* @return MIME type string based on the canonical form. Each parameter566* value is enclosed in quotes.567* A "class=" parameter is appended to the568* MIME type string to indicate the representation class name.569*/570public String toString() {571return getStringValue();572}573574/**575* Returns a hash code for this doc flavor object.576*/577public int hashCode() {578return getStringValue().hashCode();579}580581/**582* Determines if this doc flavor object is equal to the given object.583* The two are equal if the given object is not null, is an instance584* of <code>DocFlavor</code>, has a MIME type equivalent to this doc585* flavor object's MIME type (that is, the MIME types have the same media586* type, media subtype, and parameters), and has the same representation587* class name as this doc flavor object. Thus, if two doc flavor objects'588* MIME types are the same except for comments, they are considered equal.589* However, two doc flavor objects with MIME types of "text/plain" and590* "text/plain; charset=US-ASCII" are not considered equal, even though591* they represent the same media type (because the default character592* set for plain text is US-ASCII).593*594* @param obj Object to test.595*596* @return True if this doc flavor object equals <CODE>obj</CODE>, false597* otherwise.598*/599public boolean equals(Object obj) {600return601obj != null &&602obj instanceof DocFlavor &&603getStringValue().equals (((DocFlavor) obj).getStringValue());604}605606/**607* Returns this doc flavor object's string value.608*/609private String getStringValue() {610if (myStringValue == null) {611myStringValue = myMimeType + "; class=\"" + myClassName + "\"";612}613return myStringValue;614}615616/**617* Write the instance to a stream (ie serialize the object).618*/619private void writeObject(ObjectOutputStream s) throws IOException {620621s.defaultWriteObject();622s.writeObject(myMimeType.getMimeType());623}624625/**626* Reconstitute an instance from a stream (that is, deserialize it).627*628* @serialData629* The serialised form of a DocFlavor is the String naming the630* representation class followed by the String representing the canonical631* form of the mime type.632*/633private void readObject(ObjectInputStream s)634throws ClassNotFoundException, IOException {635636s.defaultReadObject();637myMimeType = new MimeType((String)s.readObject());638}639640/**641* Class DocFlavor.BYTE_ARRAY provides predefined static constant642* DocFlavor objects for example doc flavors using a byte array643* (<CODE>byte[]</CODE>) as the print data representation class.644* <P>645*646* @author Alan Kaminsky647*/648public static class BYTE_ARRAY extends DocFlavor {649650private static final long serialVersionUID = -9065578006593857475L;651652/**653* Constructs a new doc flavor with the given MIME type and a print654* data representation class name of <CODE>"[B"</CODE> (byte array).655*656* @param mimeType MIME media type string.657*658* @exception NullPointerException659* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.660* @exception IllegalArgumentException661* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not662* obey the syntax for a MIME media type string.663*/664public BYTE_ARRAY (String mimeType) {665super (mimeType, "[B");666}667668/**669* Doc flavor with MIME type = <CODE>"text/plain"</CODE>,670* encoded in the host platform encoding.671* See {@link DocFlavor#hostEncoding hostEncoding}672* Print data representation class name =673* <CODE>"[B"</CODE> (byte array).674*/675public static final BYTE_ARRAY TEXT_PLAIN_HOST =676new BYTE_ARRAY ("text/plain; charset="+hostEncoding);677678/**679* Doc flavor with MIME type =680* <CODE>"text/plain; charset=utf-8"</CODE>,681* print data representation class name = <CODE>"[B"</CODE> (byte682* array).683*/684public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 =685new BYTE_ARRAY ("text/plain; charset=utf-8");686687/**688* Doc flavor with MIME type =689* <CODE>"text/plain; charset=utf-16"</CODE>,690* print data representation class name = <CODE>"[B"</CODE> (byte691* array).692*/693public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 =694new BYTE_ARRAY ("text/plain; charset=utf-16");695696697/**698* Doc flavor with MIME type =699* <CODE>"text/plain; charset=utf-16be"</CODE>700* (big-endian byte ordering),701* print data representation class name = <CODE>"[B"</CODE> (byte702* array).703*/704public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE =705new BYTE_ARRAY ("text/plain; charset=utf-16be");706707/**708* Doc flavor with MIME type =709* <CODE>"text/plain; charset=utf-16le"</CODE>710* (little-endian byte ordering),711* print data representation class name = <CODE>"[B"</CODE> (byte712* array).713*/714public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE =715new BYTE_ARRAY ("text/plain; charset=utf-16le");716717/**718* Doc flavor with MIME type =719* <CODE>"text/plain; charset=us-ascii"</CODE>,720* print data representation class name =721* <CODE>"[B"</CODE> (byte array).722*/723public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII =724new BYTE_ARRAY ("text/plain; charset=us-ascii");725726727/**728* Doc flavor with MIME type = <CODE>"text/html"</CODE>,729* encoded in the host platform encoding.730* See {@link DocFlavor#hostEncoding hostEncoding}731* Print data representation class name =732* <CODE>"[B"</CODE> (byte array).733*/734public static final BYTE_ARRAY TEXT_HTML_HOST =735new BYTE_ARRAY ("text/html; charset="+hostEncoding);736737/**738* Doc flavor with MIME type =739* <CODE>"text/html; charset=utf-8"</CODE>,740* print data representation class name = <CODE>"[B"</CODE> (byte741* array).742*/743public static final BYTE_ARRAY TEXT_HTML_UTF_8 =744new BYTE_ARRAY ("text/html; charset=utf-8");745746/**747* Doc flavor with MIME type =748* <CODE>"text/html; charset=utf-16"</CODE>,749* print data representation class name = <CODE>"[B"</CODE> (byte750* array).751*/752public static final BYTE_ARRAY TEXT_HTML_UTF_16 =753new BYTE_ARRAY ("text/html; charset=utf-16");754755/**756* Doc flavor with MIME type =757* <CODE>"text/html; charset=utf-16be"</CODE>758* (big-endian byte ordering),759* print data representation class name = <CODE>"[B"</CODE> (byte760* array).761*/762public static final BYTE_ARRAY TEXT_HTML_UTF_16BE =763new BYTE_ARRAY ("text/html; charset=utf-16be");764765/**766* Doc flavor with MIME type =767* <CODE>"text/html; charset=utf-16le"</CODE>768* (little-endian byte ordering),769* print data representation class name = <CODE>"[B"</CODE> (byte770* array).771*/772public static final BYTE_ARRAY TEXT_HTML_UTF_16LE =773new BYTE_ARRAY ("text/html; charset=utf-16le");774775/**776* Doc flavor with MIME type =777* <CODE>"text/html; charset=us-ascii"</CODE>,778* print data representation class name =779* <CODE>"[B"</CODE> (byte array).780*/781public static final BYTE_ARRAY TEXT_HTML_US_ASCII =782new BYTE_ARRAY ("text/html; charset=us-ascii");783784785/**786* Doc flavor with MIME type = <CODE>"application/pdf"</CODE>, print787* data representation class name = <CODE>"[B"</CODE> (byte array).788*/789public static final BYTE_ARRAY PDF = new BYTE_ARRAY ("application/pdf");790791/**792* Doc flavor with MIME type = <CODE>"application/postscript"</CODE>,793* print data representation class name = <CODE>"[B"</CODE> (byte794* array).795*/796public static final BYTE_ARRAY POSTSCRIPT =797new BYTE_ARRAY ("application/postscript");798799/**800* Doc flavor with MIME type = <CODE>"application/vnd.hp-PCL"</CODE>,801* print data representation class name = <CODE>"[B"</CODE> (byte802* array).803*/804public static final BYTE_ARRAY PCL =805new BYTE_ARRAY ("application/vnd.hp-PCL");806807/**808* Doc flavor with MIME type = <CODE>"image/gif"</CODE>, print data809* representation class name = <CODE>"[B"</CODE> (byte array).810*/811public static final BYTE_ARRAY GIF = new BYTE_ARRAY ("image/gif");812813/**814* Doc flavor with MIME type = <CODE>"image/jpeg"</CODE>, print data815* representation class name = <CODE>"[B"</CODE> (byte array).816*/817public static final BYTE_ARRAY JPEG = new BYTE_ARRAY ("image/jpeg");818819/**820* Doc flavor with MIME type = <CODE>"image/png"</CODE>, print data821* representation class name = <CODE>"[B"</CODE> (byte array).822*/823public static final BYTE_ARRAY PNG = new BYTE_ARRAY ("image/png");824825/**826* Doc flavor with MIME type =827* <CODE>"application/octet-stream"</CODE>,828* print data representation class name = <CODE>"[B"</CODE> (byte829* array). The client must determine that data described830* using this DocFlavor is valid for the printer.831*/832public static final BYTE_ARRAY AUTOSENSE =833new BYTE_ARRAY ("application/octet-stream");834835}836837/**838* Class DocFlavor.INPUT_STREAM provides predefined static constant839* DocFlavor objects for example doc flavors using a byte stream ({@link840* java.io.InputStream java.io.InputStream}) as the print841* data representation class.842* <P>843*844* @author Alan Kaminsky845*/846public static class INPUT_STREAM extends DocFlavor {847848private static final long serialVersionUID = -7045842700749194127L;849850/**851* Constructs a new doc flavor with the given MIME type and a print852* data representation class name of853* <CODE>"java.io.InputStream"</CODE> (byte stream).854*855* @param mimeType MIME media type string.856*857* @exception NullPointerException858* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.859* @exception IllegalArgumentException860* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not861* obey the syntax for a MIME media type string.862*/863public INPUT_STREAM (String mimeType) {864super (mimeType, "java.io.InputStream");865}866867/**868* Doc flavor with MIME type = <CODE>"text/plain"</CODE>,869* encoded in the host platform encoding.870* See {@link DocFlavor#hostEncoding hostEncoding}871* Print data representation class name =872* <CODE>"java.io.InputStream"</CODE> (byte stream).873*/874public static final INPUT_STREAM TEXT_PLAIN_HOST =875new INPUT_STREAM ("text/plain; charset="+hostEncoding);876877/**878* Doc flavor with MIME type =879* <CODE>"text/plain; charset=utf-8"</CODE>,880* print data representation class name =881* <CODE>"java.io.InputStream"</CODE> (byte stream).882*/883public static final INPUT_STREAM TEXT_PLAIN_UTF_8 =884new INPUT_STREAM ("text/plain; charset=utf-8");885886/**887* Doc flavor with MIME type =888* <CODE>"text/plain; charset=utf-16"</CODE>,889* print data representation class name =890* <CODE>"java.io.InputStream"</CODE> (byte stream).891*/892public static final INPUT_STREAM TEXT_PLAIN_UTF_16 =893new INPUT_STREAM ("text/plain; charset=utf-16");894895/**896* Doc flavor with MIME type =897* <CODE>"text/plain; charset=utf-16be"</CODE>898* (big-endian byte ordering),899* print data representation class name =900* <CODE>"java.io.InputStream"</CODE> (byte stream).901*/902public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE =903new INPUT_STREAM ("text/plain; charset=utf-16be");904905/**906* Doc flavor with MIME type =907* <CODE>"text/plain; charset=utf-16le"</CODE>908* (little-endian byte ordering),909* print data representation class name =910* <CODE>"java.io.InputStream"</CODE> (byte stream).911*/912public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE =913new INPUT_STREAM ("text/plain; charset=utf-16le");914915/**916* Doc flavor with MIME type =917* <CODE>"text/plain; charset=us-ascii"</CODE>,918* print data representation class name =919* <CODE>"java.io.InputStream"</CODE> (byte stream).920*/921public static final INPUT_STREAM TEXT_PLAIN_US_ASCII =922new INPUT_STREAM ("text/plain; charset=us-ascii");923924/**925* Doc flavor with MIME type = <CODE>"text/html"</CODE>,926* encoded in the host platform encoding.927* See {@link DocFlavor#hostEncoding hostEncoding}928* Print data representation class name =929* <CODE>"java.io.InputStream"</CODE> (byte stream).930*/931public static final INPUT_STREAM TEXT_HTML_HOST =932new INPUT_STREAM ("text/html; charset="+hostEncoding);933934/**935* Doc flavor with MIME type =936* <CODE>"text/html; charset=utf-8"</CODE>,937* print data representation class name =938* <CODE>"java.io.InputStream"</CODE> (byte stream).939*/940public static final INPUT_STREAM TEXT_HTML_UTF_8 =941new INPUT_STREAM ("text/html; charset=utf-8");942943/**944* Doc flavor with MIME type =945* <CODE>"text/html; charset=utf-16"</CODE>,946* print data representation class name =947* <CODE>"java.io.InputStream"</CODE> (byte stream).948*/949public static final INPUT_STREAM TEXT_HTML_UTF_16 =950new INPUT_STREAM ("text/html; charset=utf-16");951952/**953* Doc flavor with MIME type =954* <CODE>"text/html; charset=utf-16be"</CODE>955* (big-endian byte ordering),956* print data representation class name =957* <CODE>"java.io.InputStream"</CODE> (byte stream).958*/959public static final INPUT_STREAM TEXT_HTML_UTF_16BE =960new INPUT_STREAM ("text/html; charset=utf-16be");961962/**963* Doc flavor with MIME type =964* <CODE>"text/html; charset=utf-16le"</CODE>965* (little-endian byte ordering),966* print data representation class name =967* <CODE>"java.io.InputStream"</CODE> (byte stream).968*/969public static final INPUT_STREAM TEXT_HTML_UTF_16LE =970new INPUT_STREAM ("text/html; charset=utf-16le");971972/**973* Doc flavor with MIME type =974* <CODE>"text/html; charset=us-ascii"</CODE>,975* print data representation class name =976* <CODE>"java.io.InputStream"</CODE> (byte stream).977*/978public static final INPUT_STREAM TEXT_HTML_US_ASCII =979new INPUT_STREAM ("text/html; charset=us-ascii");980981982/**983* Doc flavor with MIME type = <CODE>"application/pdf"</CODE>, print984* data representation class name = <CODE>"java.io.InputStream"</CODE>985* (byte stream).986*/987public static final INPUT_STREAM PDF = new INPUT_STREAM ("application/pdf");988989/**990* Doc flavor with MIME type = <CODE>"application/postscript"</CODE>,991* print data representation class name =992* <CODE>"java.io.InputStream"</CODE> (byte stream).993*/994public static final INPUT_STREAM POSTSCRIPT =995new INPUT_STREAM ("application/postscript");996997/**998* Doc flavor with MIME type = <CODE>"application/vnd.hp-PCL"</CODE>,999* print data representation class name =1000* <CODE>"java.io.InputStream"</CODE> (byte stream).1001*/1002public static final INPUT_STREAM PCL =1003new INPUT_STREAM ("application/vnd.hp-PCL");10041005/**1006* Doc flavor with MIME type = <CODE>"image/gif"</CODE>, print data1007* representation class name =1008* <CODE>"java.io.InputStream"</CODE> (byte stream).1009*/1010public static final INPUT_STREAM GIF = new INPUT_STREAM ("image/gif");10111012/**1013* Doc flavor with MIME type = <CODE>"image/jpeg"</CODE>, print data1014* representation class name =1015* <CODE>"java.io.InputStream"</CODE> (byte stream).1016*/1017public static final INPUT_STREAM JPEG = new INPUT_STREAM ("image/jpeg");10181019/**1020* Doc flavor with MIME type = <CODE>"image/png"</CODE>, print data1021* representation class name =1022* <CODE>"java.io.InputStream"</CODE> (byte stream).1023*/1024public static final INPUT_STREAM PNG = new INPUT_STREAM ("image/png");10251026/**1027* Doc flavor with MIME type =1028* <CODE>"application/octet-stream"</CODE>,1029* print data representation class name =1030* <CODE>"java.io.InputStream"</CODE> (byte stream).1031* The client must determine that data described1032* using this DocFlavor is valid for the printer.1033*/1034public static final INPUT_STREAM AUTOSENSE =1035new INPUT_STREAM ("application/octet-stream");10361037}10381039/**1040* Class DocFlavor.URL provides predefined static constant DocFlavor1041* objects.1042* For example doc flavors using a Uniform Resource Locator ({@link1043* java.net.URL java.net.URL}) as the print data1044* representation class.1045* <P>1046*1047* @author Alan Kaminsky1048*/1049public static class URL extends DocFlavor {10501051/**1052* Constructs a new doc flavor with the given MIME type and a print1053* data representation class name of <CODE>"java.net.URL"</CODE>.1054*1055* @param mimeType MIME media type string.1056*1057* @exception NullPointerException1058* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.1059* @exception IllegalArgumentException1060* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not1061* obey the syntax for a MIME media type string.1062*/1063public URL (String mimeType) {1064super (mimeType, "java.net.URL");1065}10661067/**1068* Doc flavor with MIME type = <CODE>"text/plain"</CODE>,1069* encoded in the host platform encoding.1070* See {@link DocFlavor#hostEncoding hostEncoding}1071* Print data representation class name =1072* <CODE>"java.net.URL"</CODE> (byte stream).1073*/1074public static final URL TEXT_PLAIN_HOST =1075new URL ("text/plain; charset="+hostEncoding);10761077/**1078* Doc flavor with MIME type =1079* <CODE>"text/plain; charset=utf-8"</CODE>,1080* print data representation class name =1081* <CODE>"java.net.URL"</CODE> (byte stream).1082*/1083public static final URL TEXT_PLAIN_UTF_8 =1084new URL ("text/plain; charset=utf-8");10851086/**1087* Doc flavor with MIME type =1088* <CODE>"text/plain; charset=utf-16"</CODE>,1089* print data representation class name =1090* <CODE>java.net.URL""</CODE> (byte stream).1091*/1092public static final URL TEXT_PLAIN_UTF_16 =1093new URL ("text/plain; charset=utf-16");10941095/**1096* Doc flavor with MIME type =1097* <CODE>"text/plain; charset=utf-16be"</CODE>1098* (big-endian byte ordering),1099* print data representation class name =1100* <CODE>"java.net.URL"</CODE> (byte stream).1101*/1102public static final URL TEXT_PLAIN_UTF_16BE =1103new URL ("text/plain; charset=utf-16be");11041105/**1106* Doc flavor with MIME type =1107* <CODE>"text/plain; charset=utf-16le"</CODE>1108* (little-endian byte ordering),1109* print data representation class name =1110* <CODE>"java.net.URL"</CODE> (byte stream).1111*/1112public static final URL TEXT_PLAIN_UTF_16LE =1113new URL ("text/plain; charset=utf-16le");11141115/**1116* Doc flavor with MIME type =1117* <CODE>"text/plain; charset=us-ascii"</CODE>,1118* print data representation class name =1119* <CODE>"java.net.URL"</CODE> (byte stream).1120*/1121public static final URL TEXT_PLAIN_US_ASCII =1122new URL ("text/plain; charset=us-ascii");11231124/**1125* Doc flavor with MIME type = <CODE>"text/html"</CODE>,1126* encoded in the host platform encoding.1127* See {@link DocFlavor#hostEncoding hostEncoding}1128* Print data representation class name =1129* <CODE>"java.net.URL"</CODE> (byte stream).1130*/1131public static final URL TEXT_HTML_HOST =1132new URL ("text/html; charset="+hostEncoding);11331134/**1135* Doc flavor with MIME type =1136* <CODE>"text/html; charset=utf-8"</CODE>,1137* print data representation class name =1138* <CODE>"java.net.URL"</CODE> (byte stream).1139*/1140public static final URL TEXT_HTML_UTF_8 =1141new URL ("text/html; charset=utf-8");11421143/**1144* Doc flavor with MIME type =1145* <CODE>"text/html; charset=utf-16"</CODE>,1146* print data representation class name =1147* <CODE>"java.net.URL"</CODE> (byte stream).1148*/1149public static final URL TEXT_HTML_UTF_16 =1150new URL ("text/html; charset=utf-16");11511152/**1153* Doc flavor with MIME type =1154* <CODE>"text/html; charset=utf-16be"</CODE>1155* (big-endian byte ordering),1156* print data representation class name =1157* <CODE>"java.net.URL"</CODE> (byte stream).1158*/1159public static final URL TEXT_HTML_UTF_16BE =1160new URL ("text/html; charset=utf-16be");11611162/**1163* Doc flavor with MIME type =1164* <CODE>"text/html; charset=utf-16le"</CODE>1165* (little-endian byte ordering),1166* print data representation class name =1167* <CODE>"java.net.URL"</CODE> (byte stream).1168*/1169public static final URL TEXT_HTML_UTF_16LE =1170new URL ("text/html; charset=utf-16le");11711172/**1173* Doc flavor with MIME type =1174* <CODE>"text/html; charset=us-ascii"</CODE>,1175* print data representation class name =1176* <CODE>"java.net.URL"</CODE> (byte stream).1177*/1178public static final URL TEXT_HTML_US_ASCII =1179new URL ("text/html; charset=us-ascii");118011811182/**1183* Doc flavor with MIME type = <CODE>"application/pdf"</CODE>, print1184* data representation class name = <CODE>"java.net.URL"</CODE>.1185*/1186public static final URL PDF = new URL ("application/pdf");11871188/**1189* Doc flavor with MIME type = <CODE>"application/postscript"</CODE>,1190* print data representation class name = <CODE>"java.net.URL"</CODE>.1191*/1192public static final URL POSTSCRIPT = new URL ("application/postscript");11931194/**1195* Doc flavor with MIME type = <CODE>"application/vnd.hp-PCL"</CODE>,1196* print data representation class name = <CODE>"java.net.URL"</CODE>.1197*/1198public static final URL PCL = new URL ("application/vnd.hp-PCL");11991200/**1201* Doc flavor with MIME type = <CODE>"image/gif"</CODE>, print data1202* representation class name = <CODE>"java.net.URL"</CODE>.1203*/1204public static final URL GIF = new URL ("image/gif");12051206/**1207* Doc flavor with MIME type = <CODE>"image/jpeg"</CODE>, print data1208* representation class name = <CODE>"java.net.URL"</CODE>.1209*/1210public static final URL JPEG = new URL ("image/jpeg");12111212/**1213* Doc flavor with MIME type = <CODE>"image/png"</CODE>, print data1214* representation class name = <CODE>"java.net.URL"</CODE>.1215*/1216public static final URL PNG = new URL ("image/png");12171218/**1219* Doc flavor with MIME type =1220* <CODE>"application/octet-stream"</CODE>,1221* print data representation class name = <CODE>"java.net.URL"</CODE>.1222* The client must determine that data described1223* using this DocFlavor is valid for the printer.1224*/1225public static final URL AUTOSENSE = new URL ("application/octet-stream");12261227}12281229/**1230* Class DocFlavor.CHAR_ARRAY provides predefined static constant1231* DocFlavor objects for example doc flavors using a character array1232* (<CODE>char[]</CODE>) as the print data representation class. As such,1233* the character set is Unicode.1234* <P>1235*1236* @author Alan Kaminsky1237*/1238public static class CHAR_ARRAY extends DocFlavor {12391240private static final long serialVersionUID = -8720590903724405128L;12411242/**1243* Constructs a new doc flavor with the given MIME type and a print1244* data representation class name of1245* <CODE>"[C"</CODE> (character array).1246*1247* @param mimeType MIME media type string. If it is a text media1248* type, it is assumed to contain a1249* <CODE>"charset=utf-16"</CODE> parameter.1250*1251* @exception NullPointerException1252* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.1253* @exception IllegalArgumentException1254* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not1255* obey the syntax for a MIME media type string.1256*/1257public CHAR_ARRAY (String mimeType) {1258super (mimeType, "[C");1259}12601261/**1262* Doc flavor with MIME type = <CODE>"text/plain;1263* charset=utf-16"</CODE>, print data representation class name =1264* <CODE>"[C"</CODE> (character array).1265*/1266public static final CHAR_ARRAY TEXT_PLAIN =1267new CHAR_ARRAY ("text/plain; charset=utf-16");12681269/**1270* Doc flavor with MIME type = <CODE>"text/html;1271* charset=utf-16"</CODE>, print data representation class name =1272* <CODE>"[C"</CODE> (character array).1273*/1274public static final CHAR_ARRAY TEXT_HTML =1275new CHAR_ARRAY ("text/html; charset=utf-16");12761277}12781279/**1280* Class DocFlavor.STRING provides predefined static constant DocFlavor1281* objects for example doc flavors using a string ({@link java.lang.String1282* java.lang.String}) as the print data representation class.1283* As such, the character set is Unicode.1284* <P>1285*1286* @author Alan Kaminsky1287*/1288public static class STRING extends DocFlavor {12891290private static final long serialVersionUID = 4414407504887034035L;12911292/**1293* Constructs a new doc flavor with the given MIME type and a print1294* data representation class name of <CODE>"java.lang.String"</CODE>.1295*1296* @param mimeType MIME media type string. If it is a text media1297* type, it is assumed to contain a1298* <CODE>"charset=utf-16"</CODE> parameter.1299*1300* @exception NullPointerException1301* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.1302* @exception IllegalArgumentException1303* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not1304* obey the syntax for a MIME media type string.1305*/1306public STRING (String mimeType) {1307super (mimeType, "java.lang.String");1308}13091310/**1311* Doc flavor with MIME type = <CODE>"text/plain;1312* charset=utf-16"</CODE>, print data representation class name =1313* <CODE>"java.lang.String"</CODE>.1314*/1315public static final STRING TEXT_PLAIN =1316new STRING ("text/plain; charset=utf-16");13171318/**1319* Doc flavor with MIME type = <CODE>"text/html;1320* charset=utf-16"</CODE>, print data representation class name =1321* <CODE>"java.lang.String"</CODE>.1322*/1323public static final STRING TEXT_HTML =1324new STRING ("text/html; charset=utf-16");1325}13261327/**1328* Class DocFlavor.READER provides predefined static constant DocFlavor1329* objects for example doc flavors using a character stream ({@link1330* java.io.Reader java.io.Reader}) as the print data1331* representation class. As such, the character set is Unicode.1332* <P>1333*1334* @author Alan Kaminsky1335*/1336public static class READER extends DocFlavor {13371338private static final long serialVersionUID = 7100295812579351567L;13391340/**1341* Constructs a new doc flavor with the given MIME type and a print1342* data representation class name of\1343* <CODE>"java.io.Reader"</CODE> (character stream).1344*1345* @param mimeType MIME media type string. If it is a text media1346* type, it is assumed to contain a1347* <CODE>"charset=utf-16"</CODE> parameter.1348*1349* @exception NullPointerException1350* (unchecked exception) Thrown if <CODE>mimeType</CODE> is null.1351* @exception IllegalArgumentException1352* (unchecked exception) Thrown if <CODE>mimeType</CODE> does not1353* obey the syntax for a MIME media type string.1354*/1355public READER (String mimeType) {1356super (mimeType, "java.io.Reader");1357}13581359/**1360* Doc flavor with MIME type = <CODE>"text/plain;1361* charset=utf-16"</CODE>, print data representation class name =1362* <CODE>"java.io.Reader"</CODE> (character stream).1363*/1364public static final READER TEXT_PLAIN =1365new READER ("text/plain; charset=utf-16");13661367/**1368* Doc flavor with MIME type = <CODE>"text/html;1369* charset=utf-16"</CODE>, print data representation class name =1370* <CODE>"java.io.Reader"</CODE> (character stream).1371*/1372public static final READER TEXT_HTML =1373new READER ("text/html; charset=utf-16");13741375}13761377/**1378* Class DocFlavor.SERVICE_FORMATTED provides predefined static constant1379* DocFlavor objects for example doc flavors for service formatted print1380* data.1381* <P>1382*1383* @author Alan Kaminsky1384*/1385public static class SERVICE_FORMATTED extends DocFlavor {13861387private static final long serialVersionUID = 6181337766266637256L;13881389/**1390* Constructs a new doc flavor with a MIME type of1391* <CODE>"application/x-java-jvm-local-objectref"</CODE> indicating1392* service formatted print data and the given print data1393* representation class name.1394*1395* @param className Fully-qualified representation class name.1396*1397* @exception NullPointerException1398* (unchecked exception) Thrown if <CODE>className</CODE> is1399* null.1400*/1401public SERVICE_FORMATTED (String className) {1402super ("application/x-java-jvm-local-objectref", className);1403}14041405/**1406* Service formatted print data doc flavor with print data1407* representation class name =1408* <CODE>"java.awt.image.renderable.RenderableImage"</CODE>1409* (renderable image object).1410*/1411public static final SERVICE_FORMATTED RENDERABLE_IMAGE =1412new SERVICE_FORMATTED("java.awt.image.renderable.RenderableImage");14131414/**1415* Service formatted print data doc flavor with print data1416* representation class name = <CODE>"java.awt.print.Printable"</CODE>1417* (printable object).1418*/1419public static final SERVICE_FORMATTED PRINTABLE =1420new SERVICE_FORMATTED ("java.awt.print.Printable");14211422/**1423* Service formatted print data doc flavor with print data1424* representation class name = <CODE>"java.awt.print.Pageable"</CODE>1425* (pageable object).1426*/1427public static final SERVICE_FORMATTED PAGEABLE =1428new SERVICE_FORMATTED ("java.awt.print.Pageable");14291430}14311432}143314341435