javax.print
Interface PrintService

All Known Subinterfaces:
MultiDocPrintService sample code for javax.print.MultiDocPrintService definition code for javax.print.MultiDocPrintService
All Known Implementing Classes:
StreamPrintService sample code for javax.print.StreamPrintService definition code for javax.print.StreamPrintService

public interface PrintService

Interface PrintService is the factory for a DocPrintJob. A PrintService describes the capabilities of a Printer and can be queried regarding a printer's supported attributes.

Example:

   DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
   PrintRequestAttributeSet aset = new HashPrintRequestHashAttributeSet();
   aset.add(MediaSizeName.ISO_A4);
   PrintService[] pservices =
                 PrintServiceLookup.lookupPrintServices(flavor, aset);
   if (pservices.length > 0) {
       DocPrintJob pj = pservices[0].createPrintJob();
       // InputStreamDoc is an implementation of the Doc interface //
       Doc doc = new InputStreamDoc("test.ps", flavor);
       try {
             pj.print(doc, aset);
        } catch (PrintException e) { 
        }
   }
   


Method Summary
 void addPrintServiceAttributeListener sample code for javax.print.PrintService.addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) definition code for javax.print.PrintService.addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) (PrintServiceAttributeListener sample code for javax.print.event.PrintServiceAttributeListener definition code for javax.print.event.PrintServiceAttributeListener  listener)
          Registers a listener for events on this PrintService.
 DocPrintJob sample code for javax.print.DocPrintJob definition code for javax.print.DocPrintJob createPrintJob sample code for javax.print.PrintService.createPrintJob() definition code for javax.print.PrintService.createPrintJob() ()
          Creates and returns a PrintJob capable of handling data from any of the supported document flavors.
 boolean equals sample code for javax.print.PrintService.equals(java.lang.Object) definition code for javax.print.PrintService.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Determines if two services are referring to the same underlying service.
<T extends PrintServiceAttribute sample code for javax.print.attribute.PrintServiceAttribute definition code for javax.print.attribute.PrintServiceAttribute >
T
getAttribute sample code for javax.print.PrintService.getAttribute(java.lang.Class) definition code for javax.print.PrintService.getAttribute(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <T> category)
          Gets the value of the single specified service attribute.
 PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet getAttributes sample code for javax.print.PrintService.getAttributes() definition code for javax.print.PrintService.getAttributes() ()
          Obtains this print service's set of printer description attributes giving this Print Service's status.
 Object sample code for java.lang.Object definition code for java.lang.Object getDefaultAttributeValue sample code for javax.print.PrintService.getDefaultAttributeValue(java.lang.Class) definition code for javax.print.PrintService.getDefaultAttributeValue(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > category)
          Determines this print service's default printing attribute value in the given category.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for javax.print.PrintService.getName() definition code for javax.print.PrintService.getName() ()
          Returns a String name for this print service which may be used by applications to request a particular print service.
 ServiceUIFactory sample code for javax.print.ServiceUIFactory definition code for javax.print.ServiceUIFactory getServiceUIFactory sample code for javax.print.PrintService.getServiceUIFactory() definition code for javax.print.PrintService.getServiceUIFactory() ()
          Returns a factory for UI components which allow users to interact with the service in various roles.
 Class sample code for java.lang.Class definition code for java.lang.Class <?>[] getSupportedAttributeCategories sample code for javax.print.PrintService.getSupportedAttributeCategories() definition code for javax.print.PrintService.getSupportedAttributeCategories() ()
          Determines the printing attribute categories a client can specify when setting up a job for this print service.
 Object sample code for java.lang.Object definition code for java.lang.Object getSupportedAttributeValues sample code for javax.print.PrintService.getSupportedAttributeValues(java.lang.Class, javax.print.DocFlavor, javax.print.attribute.AttributeSet) definition code for javax.print.PrintService.getSupportedAttributeValues(java.lang.Class, javax.print.DocFlavor, javax.print.attribute.AttributeSet) (Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > category, DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor, AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributes)
          Determines the printing attribute values a client can specify in the given category when setting up a job for this print service.
 DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor [] getSupportedDocFlavors sample code for javax.print.PrintService.getSupportedDocFlavors() definition code for javax.print.PrintService.getSupportedDocFlavors() ()
          Determines the print data formats a client can specify when setting up a job for this PrintService.
 AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet getUnsupportedAttributes sample code for javax.print.PrintService.getUnsupportedAttributes(javax.print.DocFlavor, javax.print.attribute.AttributeSet) definition code for javax.print.PrintService.getUnsupportedAttributes(javax.print.DocFlavor, javax.print.attribute.AttributeSet) (DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor, AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributes)
          Identifies the attributes that are unsupported for a print request in the context of a particular DocFlavor.
 int hashCode sample code for javax.print.PrintService.hashCode() definition code for javax.print.PrintService.hashCode() ()
          This method should be implemented consistently with equals(Object).
 boolean isAttributeCategorySupported sample code for javax.print.PrintService.isAttributeCategorySupported(java.lang.Class) definition code for javax.print.PrintService.isAttributeCategorySupported(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > category)
          Determines whether a client can specify the given printing attribute category when setting up a job for this print service.
 boolean isAttributeValueSupported sample code for javax.print.PrintService.isAttributeValueSupported(javax.print.attribute.Attribute, javax.print.DocFlavor, javax.print.attribute.AttributeSet) definition code for javax.print.PrintService.isAttributeValueSupported(javax.print.attribute.Attribute, javax.print.DocFlavor, javax.print.attribute.AttributeSet) (Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute  attrval, DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor, AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributes)
          Determines whether a client can specify the given printing attribute value when setting up a job for this Print Service.
 boolean isDocFlavorSupported sample code for javax.print.PrintService.isDocFlavorSupported(javax.print.DocFlavor) definition code for javax.print.PrintService.isDocFlavorSupported(javax.print.DocFlavor) (DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor)
          Determines if this print service supports a specific DocFlavor.
 void removePrintServiceAttributeListener sample code for javax.print.PrintService.removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) definition code for javax.print.PrintService.removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) (PrintServiceAttributeListener sample code for javax.print.event.PrintServiceAttributeListener definition code for javax.print.event.PrintServiceAttributeListener  listener)
          Removes the print-service listener from this print service.
 

Method Detail

getName sample code for javax.print.PrintService.getName() definition code for javax.print.PrintService.getName()

String sample code for java.lang.String definition code for java.lang.String  getName()
Returns a String name for this print service which may be used by applications to request a particular print service. In a suitable context, such as a name service, this name must be unique. In some environments this unique name may be the same as the user friendly printer name defined as the PrinterName sample code for javax.print.attribute.standard.PrinterName definition code for javax.print.attribute.standard.PrinterName attribute.

Returns:
name of the service.

createPrintJob sample code for javax.print.PrintService.createPrintJob() definition code for javax.print.PrintService.createPrintJob()

DocPrintJob sample code for javax.print.DocPrintJob definition code for javax.print.DocPrintJob  createPrintJob()
Creates and returns a PrintJob capable of handling data from any of the supported document flavors.

Returns:
a DocPrintJob object

addPrintServiceAttributeListener sample code for javax.print.PrintService.addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) definition code for javax.print.PrintService.addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener)

void addPrintServiceAttributeListener(PrintServiceAttributeListener sample code for javax.print.event.PrintServiceAttributeListener definition code for javax.print.event.PrintServiceAttributeListener  listener)
Registers a listener for events on this PrintService.

Parameters:
listener - a PrintServiceAttributeListener, which monitors the status of a print service
See Also:
removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) sample code for javax.print.PrintService.removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) definition code for javax.print.PrintService.removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener)

removePrintServiceAttributeListener sample code for javax.print.PrintService.removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) definition code for javax.print.PrintService.removePrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener)

void removePrintServiceAttributeListener(PrintServiceAttributeListener sample code for javax.print.event.PrintServiceAttributeListener definition code for javax.print.event.PrintServiceAttributeListener  listener)
Removes the print-service listener from this print service. This means the listener is no longer interested in PrintService events.

Parameters:
listener - a PrintServiceAttributeListener object
See Also:
addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) sample code for javax.print.PrintService.addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener) definition code for javax.print.PrintService.addPrintServiceAttributeListener(javax.print.event.PrintServiceAttributeListener)

getAttributes sample code for javax.print.PrintService.getAttributes() definition code for javax.print.PrintService.getAttributes()

PrintServiceAttributeSet sample code for javax.print.attribute.PrintServiceAttributeSet definition code for javax.print.attribute.PrintServiceAttributeSet  getAttributes()
Obtains this print service's set of printer description attributes giving this Print Service's status. The returned attribute set object is unmodifiable. The returned attribute set object is a "snapshot" of this Print Service's attribute set at the time of the getAttributes() method call: that is, the returned attribute set's contents will not be updated if this print service's attribute set's contents change in the future. To detect changes in attribute values, call getAttributes() again and compare the new attribute set to the previous attribute set; alternatively, register a listener for print service events.

Returns:
Unmodifiable snapshot of this Print Service's attribute set. May be empty, but not null.

getAttribute sample code for javax.print.PrintService.<T extends javax.print.attribute.PrintServiceAttribute>getAttribute(java.lang.Class<T>) definition code for javax.print.PrintService.<T extends javax.print.attribute.PrintServiceAttribute>getAttribute(java.lang.Class<T>)

<T extends PrintServiceAttribute sample code for javax.print.attribute.PrintServiceAttribute definition code for javax.print.attribute.PrintServiceAttribute > T getAttribute(Class sample code for java.lang.Class definition code for java.lang.Class <T> category)
Gets the value of the single specified service attribute. This may be useful to clients which only need the value of one attribute and want to minimise overhead.

Parameters:
category - the category of a PrintServiceAttribute supported by this service - may not be null.
Returns:
the value of the supported attribute or null if the attribute is not supported by this service.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the category is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - (unchecked exception) if category is not a Class that implements interface PrintServiceAttribute sample code for javax.print.attribute.PrintServiceAttribute definition code for javax.print.attribute.PrintServiceAttribute .

getSupportedDocFlavors sample code for javax.print.PrintService.getSupportedDocFlavors() definition code for javax.print.PrintService.getSupportedDocFlavors()

DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor [] getSupportedDocFlavors()
Determines the print data formats a client can specify when setting up a job for this PrintService. A print data format is designated by a "doc flavor" (class DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor ) consisting of a MIME type plus a print data representation class.

Note that some doc flavors may not be supported in combination with all attributes. Use getUnsupportedAttributes(..) to validate specific combinations.

Returns:
Array of supported doc flavors, should have at least one element.

isDocFlavorSupported sample code for javax.print.PrintService.isDocFlavorSupported(javax.print.DocFlavor) definition code for javax.print.PrintService.isDocFlavorSupported(javax.print.DocFlavor)

boolean isDocFlavorSupported(DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor)
Determines if this print service supports a specific DocFlavor. This is a convenience method to determine if the DocFlavor would be a member of the result of getSupportedDocFlavors().

Note that some doc flavors may not be supported in combination with all attributes. Use getUnsupportedAttributes(..) to validate specific combinations.

Parameters:
flavor - the DocFlavorto query for support.
Returns:
true if this print service supports the specified DocFlavor; false otherwise.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if flavor is null.

getSupportedAttributeCategories sample code for javax.print.PrintService.getSupportedAttributeCategories() definition code for javax.print.PrintService.getSupportedAttributeCategories()

Class sample code for java.lang.Class definition code for java.lang.Class <?>[] getSupportedAttributeCategories()
Determines the printing attribute categories a client can specify when setting up a job for this print service. A printing attribute category is designated by a Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute . This method returns just the attribute categories that are supported; it does not return the particular attribute values that are supported.

This method returns all the printing attribute categories this print service supports for any possible job. Some categories may not be supported in a particular context (ie for a particular DocFlavor). Use one of the methods that include a DocFlavor to validate the request before submitting it, such as getSupportedAttributeValues(..).

Returns:
Array of printing attribute categories that the client can specify as a doc-level or job-level attribute in a Print Request. Each element in the array is a Class sample code for java.lang.Class definition code for java.lang.Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute . The array is empty if no categories are supported.

isAttributeCategorySupported sample code for javax.print.PrintService.isAttributeCategorySupported(java.lang.Class<? extends javax.print.attribute.Attribute>) definition code for javax.print.PrintService.isAttributeCategorySupported(java.lang.Class<? extends javax.print.attribute.Attribute>)

boolean isAttributeCategorySupported(Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > category)
Determines whether a client can specify the given printing attribute category when setting up a job for this print service. A printing attribute category is designated by a Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute . This method tells whether the attribute category is supported; it does not tell whether a particular attribute value is supported.

Some categories may not be supported in a particular context (ie for a particular DocFlavor). Use one of the methods which include a DocFlavor to validate the request before submitting it, such as getSupportedAttributeValues(..).

This is a convenience method to determine if the category would be a member of the result of getSupportedAttributeCategories().

Parameters:
category - Printing attribute category to test. It must be a Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .
Returns:
true if this print service supports specifying a doc-level or job-level attribute in category in a Print Request; false if it doesn't.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if category is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - (unchecked exception) Thrown if category is not a Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .

getDefaultAttributeValue sample code for javax.print.PrintService.getDefaultAttributeValue(java.lang.Class<? extends javax.print.attribute.Attribute>) definition code for javax.print.PrintService.getDefaultAttributeValue(java.lang.Class<? extends javax.print.attribute.Attribute>)

Object sample code for java.lang.Object definition code for java.lang.Object  getDefaultAttributeValue(Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > category)
Determines this print service's default printing attribute value in the given category. A printing attribute value is an instance of a class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute . If a client sets up a print job and does not specify any attribute value in the given category, this Print Service will use the default attribute value instead.

Some attributes may not be supported in a particular context (ie for a particular DocFlavor). Use one of the methods that include a DocFlavor to validate the request before submitting it, such as getSupportedAttributeValues(..).

Not all attributes have a default value. For example the service will not have a defaultvalue for RequestingUser i.e. a null return for a supported category means there is no service default value for that category. Use the isAttributeCategorySupported(Class) method to distinguish these cases.

Parameters:
category - Printing attribute category for which the default attribute value is requested. It must be a Class sample code for java.lang.Class definition code for java.lang.Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .
Returns:
Default attribute value for category, or null if this Print Service does not support specifying a doc-level or job-level attribute in category in a Print Request, or the service does not have a default value for this attribute.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if category is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - (unchecked exception) Thrown if category is not a Class sample code for java.lang.Class definition code for java.lang.Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .

getSupportedAttributeValues sample code for javax.print.PrintService.getSupportedAttributeValues(java.lang.Class<? extends javax.print.attribute.Attribute>, javax.print.DocFlavor, javax.print.attribute.AttributeSet) definition code for javax.print.PrintService.getSupportedAttributeValues(java.lang.Class<? extends javax.print.attribute.Attribute>, javax.print.DocFlavor, javax.print.attribute.AttributeSet)

Object sample code for java.lang.Object definition code for java.lang.Object  getSupportedAttributeValues(Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > category,
                                   DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor,
                                   AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributes)
Determines the printing attribute values a client can specify in the given category when setting up a job for this print service. A printing attribute value is an instance of a class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .

If flavor is null and attributes is null or is an empty set, this method returns all the printing attribute values this Print Service supports for any possible job. If flavor is not null or attributes is not an empty set, this method returns just the printing attribute values that are compatible with the given doc flavor and/or set of attributes. That is, a null return value may indicate that specifying this attribute is incompatible with the specified DocFlavor. Also if DocFlavor is not null it must be a flavor supported by this PrintService, else IllegalArgumentException will be thrown.

If the attributes parameter contains an Attribute whose category is the same as the category parameter, the service must ignore this attribute in the AttributeSet.

DocAttributes which are to be specified on the Doc must be included in this set to accurately represent the context.

This method returns an Object because different printing attribute categories indicate the supported attribute values in different ways. The documentation for each printing attribute in package javax.print.attribute.standard describes how each attribute indicates its supported values. Possible ways of indicating support include:

Parameters:
category - Printing attribute category to test. It must be a Class sample code for java.lang.Class definition code for java.lang.Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .
flavor - Doc flavor for a supposed job, or null.
attributes - Set of printing attributes for a supposed job (both job-level attributes and document-level attributes), or null.
Returns:
Object indicating supported values for category, or null if this Print Service does not support specifying a doc-level or job-level attribute in category in a Print Request.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if category is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - (unchecked exception) Thrown if category is not a Class sample code for java.lang.Class definition code for java.lang.Class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute , or DocFlavor is not supported by this service.

isAttributeValueSupported sample code for javax.print.PrintService.isAttributeValueSupported(javax.print.attribute.Attribute, javax.print.DocFlavor, javax.print.attribute.AttributeSet) definition code for javax.print.PrintService.isAttributeValueSupported(javax.print.attribute.Attribute, javax.print.DocFlavor, javax.print.attribute.AttributeSet)

boolean isAttributeValueSupported(Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute  attrval,
                                  DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor,
                                  AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributes)
Determines whether a client can specify the given printing attribute value when setting up a job for this Print Service. A printing attribute value is an instance of a class that implements interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute .

If flavor is null and attributes is null or is an empty set, this method tells whether this Print Service supports the given printing attribute value for some possible combination of doc flavor and set of attributes. If flavor is not null or attributes is not an empty set, this method tells whether this Print Service supports the given printing attribute value in combination with the given doc flavor and/or set of attributes.

Also if DocFlavor is not null it must be a flavor supported by this PrintService, else IllegalArgumentException will be thrown.

DocAttributes which are to be specified on the Doc must be included in this set to accurately represent the context.

This is a convenience method to determine if the value would be a member of the result of getSupportedAttributeValues(...).

Parameters:
attrval - Printing attribute value to test.
flavor - Doc flavor for a supposed job, or null.
attributes - Set of printing attributes for a supposed job (both job-level attributes and document-level attributes), or null.
Returns:
True if this Print Service supports specifying attrval as a doc-level or job-level attribute in a Print Request, false if it doesn't.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) if attrval is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if flavor is not supported by this PrintService.

getUnsupportedAttributes sample code for javax.print.PrintService.getUnsupportedAttributes(javax.print.DocFlavor, javax.print.attribute.AttributeSet) definition code for javax.print.PrintService.getUnsupportedAttributes(javax.print.DocFlavor, javax.print.attribute.AttributeSet)

AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  getUnsupportedAttributes(DocFlavor sample code for javax.print.DocFlavor definition code for javax.print.DocFlavor  flavor,
                                      AttributeSet sample code for javax.print.attribute.AttributeSet definition code for javax.print.attribute.AttributeSet  attributes)
Identifies the attributes that are unsupported for a print request in the context of a particular DocFlavor. This method is useful for validating a potential print job and identifying the specific attributes which cannot be supported. It is important to supply only a supported DocFlavor or an IllegalArgumentException will be thrown. If the return value from this method is null, all attributes are supported.

DocAttributes which are to be specified on the Doc must be included in this set to accurately represent the context.

If the return value is non-null, all attributes in the returned set are unsupported with this DocFlavor. The returned set does not distinguish attribute categories that are unsupported from unsupported attribute values.

A supported print request can then be created by removing all unsupported attributes from the original attribute set, except in the case that the DocFlavor is unsupported.

If any attributes are unsupported only because they are in conflict with other attributes then it is at the discretion of the service to select the attribute(s) to be identified as the cause of the conflict.

Use isDocFlavorSupported() to verify that a DocFlavor is supported before calling this method.

Parameters:
flavor - Doc flavor to test, or null
attributes - Set of printing attributes for a supposed job (both job-level attributes and document-level attributes), or null.
Returns:
null if this Print Service supports the print request specification, else the unsupported attributes.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - ifflavor is not supported by this PrintService.

getServiceUIFactory sample code for javax.print.PrintService.getServiceUIFactory() definition code for javax.print.PrintService.getServiceUIFactory()

ServiceUIFactory sample code for javax.print.ServiceUIFactory definition code for javax.print.ServiceUIFactory  getServiceUIFactory()
Returns a factory for UI components which allow users to interact with the service in various roles. Services which do not provide any UI should return null. Print Services which do provide UI but want to be supported in an environment with no UI support should ensure that the factory is not initialised unless the application calls this method to obtain the factory. See ServiceUIFactory for more information.

Returns:
null or a factory for UI components.

equals sample code for javax.print.PrintService.equals(java.lang.Object) definition code for javax.print.PrintService.equals(java.lang.Object)

boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Determines if two services are referring to the same underlying service. Objects encapsulating a print service may not exhibit equality of reference even though they refer to the same underlying service.

Clients should call this method to determine if two services are referring to the same underlying service.

Services must implement this method and return true only if the service objects being compared may be used interchangeably by the client. Services are free to return the same object reference to an underlying service if that, but clients must not depend on equality of reference.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this service is the same as the obj argument, false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.print.PrintService.hashCode() definition code for javax.print.PrintService.hashCode()

int hashCode()
This method should be implemented consistently with equals(Object).

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
hash code of this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable