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