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 type
s 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 BarcodeURNFactory
Returns 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 void
initialize
(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, wait
Methods 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:
getNID
in interfaceIURNProvider
- Returns:
- The
NID.BARCODE
.
getResourceTypes
Gets the URN Resource Type supported by the provider.- Specified by:
getResourceTypes
in 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:
parse
in 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 "?+"),null
for none.query
- The decoded query String (without "?="),null
for none.fragment
- The decoded fragment,null
for none.- Returns:
- The URN instance.
- Throws:
URNException
- For URN exceptions.