293 lines · 18.1 KB · HTML
RawDownload
<html><head><title>javax.print.attribute.standard package</title><!--Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License version 2 only, aspublished by the Free Software Foundation.  Oracle designates thisparticular file as subject to the "Classpath" exception as providedby Oracle in the LICENSE file that accompanied this code. This code is distributed in the hope that it will be useful, but WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public Licenseversion 2 for more details (a copy is included in the LICENSE file thataccompanied this code). You should have received a copy of the GNU General Public License version2 along with this work; if not, write to the Free Software Foundation,Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USAor visit www.oracle.com if you need additional information or have anyquestions.--></head><body bgcolor="white">Package javax.print.attribute.standardcontains classes for specific printing attributes.The parent package,<A HREF="../package-summary.html">javax.print.attribute</A>,provides classes and interfaces that describe the types of JavaPrint Service attributes and how they can be collected into attributesets.<P>An attribute represents a printing featurethat a print service can provide.For each attribute,a print service either does or does not support the attribute.For each possible value of a supported attribute,a print service either does or does not support the value.<P>The API requires every print serviceto support certain attributes;other attributes are optionaland the service can choose whether or not to support them.Each attribute has a set of values that it accepts.  The API requires every print service to support certain values forcertain attributes;other attribute values are optionaland the service can choose whether or not to support them.These support requirements are recorded in the documentationfor each attribute class.<P>Package javax.print.attribute.standardcontains standard printing attributesand standard printing attribute valuesthat are widely used in the printing domain.A print service vendorcan provide new vendor-specific printing attributesin addition to the standard ones.A vendor can also providevendor-specific extensions (subclasses)of the standard printing attributes --for example,to provide additional vendor-specific valuesfor an existing standard attribute.Of course,if a vendor wants clientsto be able to use any added or extended attributes,the vendor must publish the new attribute classes.<P>Many of the standard attribute classes extend one of the abstract syntax classes of the javax.print.attribute package.These abstract syntax classes each represent a different type.  The <a href="../EnumSyntax.html">EnumSyntax</a> class, for example, represents a type-safeenumeration.  The abstract syntax class provides a wrapper for the attribute value.  <p>If an attribute class extends <code>EnumSyntax</code>, and the value of the attribute is an IPP-compatible value, the attribute's <code>toString</code> method returns the IPP string representation of the attribute value, such as"processing-stopped" for the <a href="JobState.html">JobState</a> attribute.  However, because the <code>EnumSyntax</code> class is extensible, vendors can define their own attribute values.  If an attribute uses the <code>EnumSyntax</code> class and is set to one of these vendor-defined values then the <code>toString</code> method will not return the IPP string representation of the value.<p>A printing client applicationwill typically not need to useall the printing attribute classesin package javax.print.attribute.standard,just the ones that pertain to the application.<P>The attribute classes in package javax.print.attribute.standardare based on the Internet Printing Protocol (IPP) attributesas defined in the Internet RFC document,<I>RFC 2911 Internet Printing Protocol/1.1: Model and Semantics</I>dated September 2000.See <a HREF="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a>for more information.The descriptive text for each attribute classwas taken largely from the above documents.The above authors' contribution to the APIis gratefully acknowledged. <H3>Attribute Organization</H3>There are five kinds of printing attributes:doc attributes,print request attributes,print job attributes,print service attributes,and supported-values attributes. <H4>Doc Attributes</H4>Doc attributes specify the characteristics of an individual docand the print job settings to be applied to an individual doc.A doc attribute class implements interface<A HREF="../DocAttribute.html">DocAttribute</A>.A doc attribute can appear in a <a href="../DocAttributeSet.html">DocAttributeSet</a>. <H4>Print Request Attributes</H4>Print request attributesspecify the settings to be applied to a whole print joband to all the docs in the print job. A print request attribute class implements interface<A HREF="../PrintRequestAttribute.html">PrintRequestAttribute</A>.A print request attribute can appear in a   <a href="../PrintRequestAttributeSet.html">PrintRequestAttributeSet</a>. <P>Some attributes are doc attributesbut not print request attributesand may only be specified at the doc level.Some attributes are print request attributesbut not doc attributesand may only be specified at the Print Request level.Some attributes are both doc attributesand print request attributesand may be specified either at the doc levelor at the Print Request level.<P>When specified at the doc level,an attribute applies just to that one doc.When specified at the Print Request level,an attribute applies to the whole job,including all the docs in the job.However, an attribute specified at the doc leveloverrides an attribute in the same categoryspecified at the Print Request level. <H4>Print Job Attributes</H4>Print job attributes report the status of a Print Job.A print job attribute class implements interface<A HREF="../PrintJobAttribute.html">PrintJobAttribute</A>.A print job attributecan appear in a <A HREF="../PrintJobAttributeSet.html">PrintJobAttributeSet</A>.<P>Some attributes are both print request attributesand print job attributes;a client may include such attributes in a Print Requestto specify characteristics for the ensuing Print Job,and those attributes then also appearin the Print Job's attribute set.Some attributes are print job attributesbut not print request attributes;the print service itselfadds these attributes to the Print Job's attribute set. <H4>Print Service Attributes</H4>Print service attributes report the statusof a print service.A print service attribute class implements interface<A HREF="../PrintServiceAttribute.html">PrintServiceAttribute</A>.A print service attributecan appear in a <A HREF="../PrintServiceAttributeSet.html">PrintServiceAttributeSet</A>. <H4>Supported-Values Attributes</H4>A supported-value attributeindicates the legal values for another attributethat a print service supports.A supported-values attribute class implements interface<A HREF="../SupportedValuesAttribute.html">SupportedValuesAttribute</A>.However, supported-values attributesnever appear in attribute sets,so there is no restricted <A HREF="../AttributeSet.html">AttributeSet</A>subinterface for them.<P> <H4>Attribute Table</H4>The table below lists all the printing attributes.The table shows the tagging interfaceseach attribute class implementsin addition to interface <A HREF="../Attribute.html">Attribute</A>,thus indicating how each attribute is used in the API.For each doc attribute and print request attribute,the column marked "SupportedValuesAttribute"lists the supported-values attribute class, if any,with which a print service indicates the supported values for that attribute category.<P><TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Lists all printing attributes as described in above text"><TR BGCOLOR="#E5E5E5"><TH VALIGN="bottom">Attribute Class</TH><TH VALIGN="bottom">Doc<BR>Attribute</TH><TH VALIGN="bottom">Print<BR>Request<BR>Attribute</TH><TH VALIGN="bottom">Print<BR>Job<BR>Attribute</TH><TH VALIGN="bottom">Print<BR>Service<BR>Attribute</TH><TH VALIGN="bottom">SupportedValuesAttribute</TH></TR><TR><TD><A HREF="Compression.html">Compression</A></TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="DocumentName.html">DocumentName</A></TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="Chromaticity.html">Chromaticity</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="Copies.html">Copies</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="CopiesSupported.html">CopiesSupported</A></TD></TR><TR><TD><A HREF="Finishings.html">Finishings</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobHoldUntil.html">JobHoldUntil</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobImpressions.html">JobImpressions</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobImpressionsSupported.html">JobImpressionsSupported</A></TD></TR><TR><TD><A HREF="JobKOctets.html">JobKOctets</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobKOctetsSupported.html">JobKOctetsSupported</A></TD></TR><TR><TD><A HREF="JobMediaSheets.html">JobMediaSheets</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobMediaSheetsSupported.html">JobMediaSheetsSupported</A></TD></TR><TR><TD><A HREF="JobName.html">JobName</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobPriority.html">JobPriority</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobPrioritySupported.html">JobPrioritySupported</A></TD></TR><TR><TD><A HREF="JobSheets.html">JobSheets</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="Media.html">Media</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="MediaSize.html">MediaSize</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="MultipleDocumentHandling.html">MultipleDocumentHandling</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="NumberUp.html">NumberUp</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="NumberUpSupported.html">NumberUpSupported</A></TD></TR><TR><TD><A HREF="OrientationRequested.html">OrientationRequested</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PageRanges.html">PageRanges</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PresentationDirection.html">PresentationDirection</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterResolution.html">PrinterResolution</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrintQuality.html">PrintQuality</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="RequestingUserName.html">RequestingUserName</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="SheetCollate.html">SheetCollate</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="Sides.html">Sides</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="DateTimeAtCompleted.html">DateTimeAtCompleted</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="DateTimeAtCreation.html">DateTimeAtCreation</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="DateTimeAtProcessing.html">DateTimeAtProcessing</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobImpressionsCompleted.html">JobImpressionsCompleted</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobKOctetsProcessed.html">JobKOctetsProcessed</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobMediaSheetsCompleted.html">JobMediaSheetsCompleted</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobMessageFromOperator.html">JobMessageFromOperator</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobOriginatingUserName.html">JobOriginatingUserName</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobState.html">JobState</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="JobStateReasons.html">JobStateReasons</A><BR>Contains zero or more --</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD>-- <A HREF="JobStateReason.html">JobStateReason</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="NumberOfDocuments.html">NumberOfDocuments</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="NumberOfInterveningJobs.html">NumberOfInterveningJobs</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="OutputDeviceAssigned.html">OutputDeviceAssigned</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="ColorSupported.html">ColorSupported</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PagesPerMinute.html">PagesPerMinute</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PagesPerMinuteColor.html">PagesPerMinuteColor</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PDLOverrideSupported.html">PDLOverrideSupported</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterIsAcceptingJobs.html">PrinterIsAcceptingJobs</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterInfo.html">PrinterInfo</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterLocation.html">PrinterLocation</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterMessageFromOperator.html">PrinterMessageFromOperator</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterMakeAndModel.html">PrinterMakeAndModel</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterMoreInfo.html">PrinterMoreInfo</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterMoreInfoManufacturer.html">PrinterMoreInfoManufacturer</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterName.html">PrinterName</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterState.html">PrinterState</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="PrinterStateReasons.html">PrinterStateReasons</A><BR>Contains zero or more --</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD>-- <A HREF="PrinterStateReason.html">PrinterStateReason</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD>-- <A HREF="Severity.html">Severity</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="QueuedJobCount.html">QueuedJobCount</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR><TR><TD><A HREF="ReferenceUriSchemesSupported.html">ReferenceUriSchemesSupported</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR></TABLE><P>Please note: In the javax.print APIs, a null reference parameter to methods is incorrect unless explicitly documented on the method as having a meaningfulinterpretation. Usage to the contrary is incorrect coding and may resultin a run time exception either immediately or at some later time.IllegalArgumentException and NullPointerException are examples oftypical and acceptable run time exceptions for such cases.<P>@since 1.4</body></html>