Class ImageURNFactory

  • All Implemented Interfaces:
    IURNProvider

    public class ImageURNFactory
    extends java.lang.Object
    implements IURNProvider
    Image provider for iizi URN's.

    Image URN's are encoded in iizi as: dasjdshkhdkjhkjahjkfhsjk hjkfhjkasd

    urn:iz-img:SVG_ENCODED_DATA?=size:WIDTHxHEIGHT

    The "?=size:WIDTHxHEIGHT" specifies that the SVG should be scaled in size of logical pixel to WIDTH and HEIGHT.

    Author:
    Christopher Mindus
    • Method Detail

      • initialize

        public static void initialize​(URNFactory factory,
                                      IImageURNProvider provider)
        Initializes the Image URN factory.

        This method is not intended to be called by user code, the system will handle it.

        Parameters:
        factory - The URN factory instance.
        provider - The Image URN provider.
        Throws:
        java.lang.RuntimeException - If this method is called twice for the same URN provider.
      • getInstance

        public static ImageURNFactory getInstance()
        Gets the singleton instance of the Image URN factory.
        Returns:
        The Image URN factory instance.
      • getResourceTypes

        public java.util.List<URNResourceType> getResourceTypes()
        Gets the location or locations supported by the provider.
        Specified by:
        getResourceTypes in interface IURNProvider
        Returns:
        The supported locations: ALL.
      • 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.