Package com.iizix.barcode
Class BarcodeURNFactory
java.lang.Object
com.iizix.barcode.BarcodeURNFactory
- All Implemented Interfaces:
IURNProvider
Barcode provider for IIZI URN's.
Barcode URN's are encoded in IIZI as:
urn:iz-barcode:type:text[:width=w][:height:h][:param1=value1:...:paramN=valueN]
where the valid types are (in lower case):
- AZTEC *,
- CODABAR,
- CODE_39,
- CODE_93,
- CODE_128,
- DATA_MATRIX *,
- EAN_8,
- EAN_13,
- ITF,
- PDF_417 *,
- QR_CODE *,
- UPC_A; and
- UPC_E.
The types marked with an asterisk '*' are two dimensional. Generally all barcodes needs a width and height to be displayed properly.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionstatic BarcodeURNFactoryReturns the singleton instance of the barcode URN factory.getNID()Gets the Naming IDentifier of the provider.Gets the URN Resource Type supported by the provider.static voidinitialize(URNFactory factory) Initializes the barcode URN factory.Parses the URN after the NID specification, i.e.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.iizix.urn.IURNProvider
paramString0
Method Details
initialize
Initializes the barcode URN factory.This method is not intended to be called by user code, the system will handle it.
- Parameters:
factory- The URN factory instance.- Throws:
RuntimeException- If this method is called twice for the same URN provider.
getInstance
Returns the singleton instance of the barcode URN factory.- Returns:
- The barcode URN factory instance.
getNID
Gets the Naming IDentifier of the provider.- Specified by:
getNIDin interfaceIURNProvider- Returns:
- The
NID.BARCODE.
getResourceTypes
Gets the URN Resource Type supported by the provider.- Specified by:
getResourceTypesin interfaceIURNProvider- Returns:
- There are no supported resource types for the barcode, so an empty list is returned.
parse
public URN parse(String urnString, String nss, String req, String query, String fragment) throws URNException Parses the URN after the NID specification, i.e. after "urn:NID:".- Specified by:
parsein interfaceIURNProvider- Parameters:
urnString- The full unparsed original URN string.nss- The NSS part of the string (before request/query/fragment).req- The decoded request String (without "?+"),nullfor none.query- The decoded query String (without "?="),nullfor none.fragment- The decoded fragment,nullfor none.- Returns:
- The URN instance.
- Throws:
URNException- For URN exceptions.