Class SimpleResourceFactory

    • Field Detail

      • mClassMap

        protected Map<Class<? extends ResourceSpecifier>,​List<Class<? extends Resource>>> mClassMap
        Map from ResourceSpecifier Class to List of Resource Classes. Resource initialization is attempted in reverse order through this List, so more recently registered classes are tried first.
    • Constructor Detail

      • SimpleResourceFactory

        public SimpleResourceFactory()
    • Method Detail

      • addMapping

        public void addMapping​(Class<? extends ResourceSpecifier> aSpecifierInterface,
                               Class<? extends Resource> aResourceClass)
        Configures this SimpleResourceFactory by adding a new mapping between a ResourceSpecifier class and a Resource class.
        Parameters:
        aSpecifierInterface - the subinterface of ResourceSpecifier.
        aResourceClass - a subclass of Resource that is to be instantiated from resource specifiers of the given class.
      • addMapping

        public void addMapping​(String aSpecifierInterfaceName,
                               String aResourceClassName)
                        throws ClassNotFoundException
        Configures this SimpleResourceFactory by adding a new mapping between a ResourceSpecifier class and a Resource class.
        Parameters:
        aSpecifierInterfaceName - name of the subinterface of ResourceSpecifier.
        aResourceClassName - the name of a subclass of Resource that is to be instantiated from resource specifiers of the given class.
        Throws:
        ClassNotFoundException - -