Class BarcodeURNFactory

java.lang.Object
com.iizix.barcode.BarcodeURNFactory
All Implemented Interfaces:
IURNProvider

public class BarcodeURNFactory extends Object implements 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 Details

    • initialize

      public static void initialize(URNFactory factory)
      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

      public static BarcodeURNFactory getInstance()
      Returns the singleton instance of the barcode URN factory.
      Returns:
      The barcode URN factory instance.
    • getNID

      public NID getNID()
      Gets the Naming IDentifier of the provider.
      Specified by:
      getNID in interface IURNProvider
      Returns:
      The NID.BARCODE.
    • getResourceTypes

      public List<URNResourceType> getResourceTypes()
      Gets the URN Resource Type supported by the provider.
      Specified by:
      getResourceTypes in interface IURNProvider
      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 interface IURNProvider
      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.