Package com.zebra.sdk.printer
Class ZebraPrinterFactory
Object
com.zebra.sdk.printer.ZebraPrinterFactory
A factory used to acquire an instance of a ZebraPrinter.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZebraPrinterLinkOscreateLinkOsPrinter(ZebraPrinter genericPrinter) Create a wrapper around a Zebra printer that provides access to Link-OS features.static ZebraPrinterLinkOscreateLinkOsPrinter(ZebraPrinter genericPrinter, LinkOsInformation info) Create a wrapper around a Zebra printer that provides access to Link-OS features.static ZebraPrinterLinkOscreateLinkOsPrinter(ZebraPrinter genericPrinter, LinkOsInformation info, PrinterLanguage language) Create a wrapper around a Zebra printer that provides access to Link-OS features.static ZebraPrinterLinkOscreateLinkOsPrinter(ZebraPrinter genericPrinter, PrinterLanguage language) Create a wrapper around a Zebra printer that provides access to Link-OS features.static ZebraPrintergetInstance(Connection connection) Factory method to create the correctZebraPrinterconcrete class based on the printer's control language.static ZebraPrintergetInstance(PrinterLanguage language, Connection connection) Factory method to create the correctZebraPrinterconcrete class based on the provided printer control language.static ZebraPrintergetInstance(String[] cpclFwVersionPrefixes, Connection connection) Factory method to create the correctZebraPrinterconcrete class based on the printer's control language.static ZebraPrinterLinkOsgetLinkOsPrinter(Connection connection) Create Link-OS Zebra printer from a connection that provides access to Link-OS features.static ZebraPrinterLinkOsgetLinkOsPrinter(Connection connection, LinkOsInformation info) Create Link-OS Zebra printer from a connection that provides access to Link-OS features.static ZebraPrinterLinkOsgetLinkOsPrinter(Connection connection, LinkOsInformation info, PrinterLanguage language) Create Link-OS Zebra printer from a connection that provides access to Link-OS features.static ZebraPrinterLinkOsgetLinkOsPrinter(Connection connection, PrinterLanguage language) Create Link-OS Zebra printer from a connection that provides access to Link-OS features.
-
Method Details
-
getInstance
public static ZebraPrinter getInstance(Connection connection) throws ConnectionException, ZebraPrinterLanguageUnknownException Factory method to create the correctZebraPrinterconcrete class based on the printer's control language. If the Set-Get-Do value,appl.name, starts with one of the following, the printer is determined to be a CPCL printer. Otherwise it is considered to be a ZPL printer
- SH
- H8
- C
getInstance(String[], Connection)- Parameters:
connection- an open connection to a printer- Returns:
- an instance of a
ZebraPrinter - Throws:
ConnectionException- if an I/O error occursZebraPrinterLanguageUnknownException- if the printer language cannot be determined
-
getInstance
public static ZebraPrinter getInstance(String[] cpclFwVersionPrefixes, Connection connection) throws ConnectionException, ZebraPrinterLanguageUnknownException Factory method to create the correctZebraPrinterconcrete class based on the printer's control language. If the Set-Get-Do value,appl.name, starts with one of thecpclFwVersionPrefixes, the printer is determined to be a CPCL printer. Otherwise it is considered to be a ZPL printer- Parameters:
cpclFwVersionPrefixes- an array of possible CPCL version number prefixesconnection- an open connection to a printer- Returns:
- an instance of a
ZebraPrinter - Throws:
ConnectionException- if an I/O error occursZebraPrinterLanguageUnknownException- if the printer language cannot be determined
-
getInstance
public static ZebraPrinter getInstance(PrinterLanguage language, Connection connection) throws ConnectionException Factory method to create the correctZebraPrinterconcrete class based on the provided printer control language.- Parameters:
language- the language of the printer instance to be createdconnection- an open connection to a printer- Returns:
- an instance of a
ZebraPrinter - Throws:
ConnectionException- if an I/O error occurs
-
createLinkOsPrinter
public static ZebraPrinterLinkOs createLinkOsPrinter(ZebraPrinter genericPrinter) throws ConnectionException Create a wrapper around a Zebra printer that provides access to Link-OS features. This method will query the printer for its Link-OS version and its control language.- Parameters:
genericPrinter- An instance of aZebraPrinter.- Returns:
- a Link-OS printer
- Throws:
ConnectionException- if an I/O error occurs
-
createLinkOsPrinter
public static ZebraPrinterLinkOs createLinkOsPrinter(ZebraPrinter genericPrinter, LinkOsInformation info) throws ConnectionException Create a wrapper around a Zebra printer that provides access to Link-OS features. This method will query the printer for its control language, but will not query the printer for Link-OS information.- Parameters:
genericPrinter- An instance of aZebraPrinter.info- Link-OS Information- Returns:
- a Link-OS printer
- Throws:
ConnectionException- if an I/O error occurs
-
createLinkOsPrinter
public static ZebraPrinterLinkOs createLinkOsPrinter(ZebraPrinter genericPrinter, PrinterLanguage language) throws ConnectionException Create a wrapper around a Zebra printer that provides access to Link-OS features. This method will query the printer for its Link-OS information, but will not query the printer for its control language.- Parameters:
genericPrinter- An instance of aZebraPrinter.language- The printer control language- Returns:
- a Link-OS printer
- Throws:
ConnectionException- if an I/O error occurs
-
createLinkOsPrinter
public static ZebraPrinterLinkOs createLinkOsPrinter(ZebraPrinter genericPrinter, LinkOsInformation info, PrinterLanguage language) throws ConnectionException Create a wrapper around a Zebra printer that provides access to Link-OS features. This method will not query the printer for any information but will use the suppliedinfoandlanguage.- Parameters:
genericPrinter- An instance of aZebraPrinter.info- Link-OS Informationlanguage- The printer control language- Returns:
- a Link-OS printer
- Throws:
ConnectionException- if an I/O error occurs
-
getLinkOsPrinter
Create Link-OS Zebra printer from a connection that provides access to Link-OS features. This method will query the printer for its Link-OS version and its control language.- Parameters:
connection- an open connection to a Link-OS printer- Returns:
- a Link-OS printer or null if the printer doesn't support Link-OS features
- Throws:
ConnectionException- if an I/O error occurs
-
getLinkOsPrinter
public static ZebraPrinterLinkOs getLinkOsPrinter(Connection connection, LinkOsInformation info) throws ConnectionException Create Link-OS Zebra printer from a connection that provides access to Link-OS features. This method will query the printer for its control language, but will not query the printer for Link-OS information.- Parameters:
connection- an open connection to a Link-OS printerinfo- Link-OS Information- Returns:
- a Link-OS printer or null if the printer doesn't support Link-OS features
- Throws:
ConnectionException- if an I/O error occurs
-
getLinkOsPrinter
public static ZebraPrinterLinkOs getLinkOsPrinter(Connection connection, PrinterLanguage language) throws ConnectionException Create Link-OS Zebra printer from a connection that provides access to Link-OS features. This method will query the printer for its Link-OS information, but will not query the printer for its control language.- Parameters:
connection- an open connection to a Link-OS printerlanguage- The printer control language- Returns:
- a Link-OS printer or null if the printer doesn't support Link-OS features
- Throws:
ConnectionException- if an I/O error occurs
-
getLinkOsPrinter
public static ZebraPrinterLinkOs getLinkOsPrinter(Connection connection, LinkOsInformation info, PrinterLanguage language) throws ConnectionException Create Link-OS Zebra printer from a connection that provides access to Link-OS features. This method will not query the printer for any information but will use the suppliedinfoandlanguage.- Parameters:
connection- an open connection to a Link-OS printerinfo- Link-OS Informationlanguage- The printer control language- Returns:
- a Link-OS printer or null if the printer doesn't support Link-OS features
- Throws:
ConnectionException- if an I/O error occurs
-