Class BarcodeURNFactory

  • All Implemented Interfaces:
    IURNProvider

    public class BarcodeURNFactory
    extends java.lang.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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static BarcodeURNFactory getInstance()
      Returns the singleton instance of the barcode URN factory.
      NID getNID()
      Gets the Naming IDentifier of the provider.
      java.util.List<URNResourceType> getResourceTypes()
      Gets the URN Resource Type supported by the provider.
      static void initialize​(URNFactory factory)
      Initializes the barcode URN factory.
      URN parse​(java.lang.String urnString, java.lang.String nss, java.lang.String req, java.lang.String query, java.lang.String fragment)
      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
    • Method Detail

      • 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:
        java.lang.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.
      • getResourceTypes

        public java.util.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​(java.lang.String urnString,
                         java.lang.String nss,
                         java.lang.String req,
                         java.lang.String query,
                         java.lang.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.