Once the printer starts processing the print job, additional information about the job becomes available, which might include: the job state (such as completed or queued) and the number of pages printed so far. These pieces of information are also attributes. Attributes can also describe the printer itself, such as: the printer name, the printer location, and the number of jobs queued.
The Java Print
Service API defines these different kinds of attribute roles with
five subinterfaces of Attribute
:
PrintRequestAttribute
is used by an application to represents a
setting applied to an entire print job and to specify how the
entire print job should be printed.DocAttribute
is
used by an application to specify a characteristic of a single
document and the print job settings to be applied to the
document.PrintJobAttribute
is used by a print service to report how a job is being printed.
These values will usually be identical the requested attribute
values. However, if the printer does not support the value of a
print request attribute then the corresponding print job attribute
contains a different value that is supported by the printerPrintServiceAttribute
is used by a print service to report the
status of the print service.SupportedValuesAttribute
is used by a print service to indicate the
range of values supported for a request attribute. For example, a
printer might support only a certain range of copies. When a print
service is queried for the supported range of copies, it returns
this information in a CopiesSupported
object, which implements
SupportedValuesAttribute
.Media
attribute
belongs to the document, print job, and print request roles because the
Media
attribute can describe the paper size, the paper tray, or
paper type. In fact, most document attributes are also print request
attributes, and all print request attributes are also print job attributes.
The next section describes how to collect attributes together into attribute sets, which also have roles.