Interface Printer
- All Known Implementing Classes:
AbstractPrinter, UnixPrinter
Printer interface representing a printer device.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPrinter status enumeration. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the user-friendly description of the printer.Retrieves the driver name or make/model of the printer.getName()Retrieves the name of the printer.Retrieves the port name or device URI of the printer.Retrieves the current status of the printer.Retrieves the reason for the current printer status, if available.booleanIndicates whether this is the default printer.booleanisLocal()Indicates whether this is a local printer (as opposed to a network printer).
-
Method Details
-
getName
-
getDriverName
String getDriverName()Retrieves the driver name or make/model of the printer.- Returns:
- The driver or model name.
-
getDescription
String getDescription()Retrieves the user-friendly description of the printer.- Returns:
- The printer description.
-
getStatus
Printer.PrinterStatus getStatus()Retrieves the current status of the printer.- Returns:
- The printer status.
-
getStatusReason
String getStatusReason()Retrieves the reason for the current printer status, if available.- Returns:
- A string describing the status reason (e.g., "Paper Jam", "media-empty"), or empty string if none.
-
isDefault
boolean isDefault()Indicates whether this is the default printer.- Returns:
trueif this is the default printer,falseotherwise.
-
isLocal
boolean isLocal()Indicates whether this is a local printer (as opposed to a network printer).- Returns:
trueif this is a local printer,falseif it is a network printer.
-
getPortName
String getPortName()Retrieves the port name or device URI of the printer.- Returns:
- The port name or URI.
-