ilog.rules.brl.value.info

Class IlrValueInfoFactory

  • java.lang.Object
    • ilog.rules.brl.value.info.IlrValueInfoFactory


  • public abstract class IlrValueInfoFactory
    extends java.lang.Object
    Retrieves a value info with a unique key that represents this value info. The value info factory is a hierarchy of factories. By default, the root factory interprets the key as a class name. It tries to load and instantiate the class defined by the key. The class must have a public constructor with no parameter. The default factory can be extended in order to load value info in a different way.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      protected static IlrValueInfo createValueInfo(java.lang.String key, java.lang.Class descClass)
      Creates a value info.
      static IlrValueInfo findValueInfo(java.lang.String key, IlrVocabulary vocabulary, java.lang.ClassLoader classLoader)
      Loads a value info into the value info hierarchy based on the key that defines that value info.
      static IlrValueInfo findValueInfo(java.lang.String key, IlrVocabulary vocabulary, java.lang.ClassLoader classLoader, boolean logError)
      Loads a value info into the value info hierarchy based on the key that defines that value info.
      static IlrValueInfoFactory getFactory()
      Returns the current value info factory.
      static IlrBRLLogger getLogger()
      This method retrieves a logger that may have been assigned to this factory.
      protected static java.lang.Class loadClass(java.lang.String className, java.lang.ClassLoader classLoader)
      Loads a class by looking first in the class loader given in parameter and then in the IlrValueInfoFactory class loader.
      protected abstract IlrValueInfo loadValueInfo(java.lang.String key, IlrVocabulary vocabulary, java.lang.ClassLoader classLoader)
      Loads a value info based on the key that defines that value info, through the factory implementation.
      static void setFactory(IlrValueInfoFactory factory)
      Sets the new current value info factory.
      static void setLogger(IlrBRLLogger log)
      Sets a logger with this factory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrValueInfoFactory

        protected IlrValueInfoFactory(IlrValueInfoFactory parent)
        Constructs a value info factory, with its parent factory.
        Parameters:
        parent - The parent factory.
    • Method Detail

      • getFactory

        public static IlrValueInfoFactory getFactory()
        Returns the current value info factory.
        Returns:
        The current value info factory.
      • setFactory

        public static void setFactory(IlrValueInfoFactory factory)
        Sets the new current value info factory.
        Parameters:
        factory - The value info factory.
      • getLogger

        public static IlrBRLLogger getLogger()
        This method retrieves a logger that may have been assigned to this factory. The logger is used to report errors while loading and instantiating value management classes.
        Returns:
        a logger associated to this factory
      • setLogger

        public static void setLogger(IlrBRLLogger log)
        Sets a logger with this factory.
        Parameters:
        log - The logger to be associated with this factory.
      • createValueInfo

        protected static IlrValueInfo createValueInfo(java.lang.String key,
                                   java.lang.Class descClass)
        Creates a value info. By default, instantiates the class through a constructor with no parameter.
        Parameters:
        key - The key of the value descriptor.
        descClass - The class to instantiate.
      • loadClass

        protected static java.lang.Class loadClass(java.lang.String className,
                                java.lang.ClassLoader classLoader)
        Loads a class by looking first in the class loader given in parameter and then in the IlrValueInfoFactory class loader.
        Parameters:
        className - The class name.
        classLoader - The class loader into which the class is loaded.
        Returns:
        The class according to the class name or null if the class does not exist.
      • loadValueInfo

        protected abstract IlrValueInfo loadValueInfo(java.lang.String key,
                                 IlrVocabulary vocabulary,
                                 java.lang.ClassLoader classLoader)
        Loads a value info based on the key that defines that value info, through the factory implementation.
        Parameters:
        key - The key that represents the value info.
        vocabulary - The vocabulary.
        classLoader - The class loader.
        Returns:
        The instance of the value info defined by the key.
      • findValueInfo

        public static IlrValueInfo findValueInfo(java.lang.String key,
                                 IlrVocabulary vocabulary,
                                 java.lang.ClassLoader classLoader)
        Loads a value info into the value info hierarchy based on the key that defines that value info.
        Parameters:
        key - The key that represents the value info. An error is logged if the value info is not found.
        vocabulary - The vocabulary.
        classLoader - The class loader.
        Returns:
        The instance of the value info defined by the key or null if the value info is not found.
      • findValueInfo

        public static IlrValueInfo findValueInfo(java.lang.String key,
                                 IlrVocabulary vocabulary,
                                 java.lang.ClassLoader classLoader,
                                 boolean logError)
        Loads a value info into the value info hierarchy based on the key that defines that value info.
        Parameters:
        key - The key that represents the value info.
        vocabulary - The vocabulary.
        classLoader - The class loader.
        logError - true to log an error if the value info is not found in the factory hierarchy.
        Returns:
        The instance of the value info defined by the key.

© Copyright IBM Corp. 1987, 2017