/**
  * Factory method to create a defaulting map.
  * <p>
  * The factory specified is called when a missing key is found.
  * The result will be returned as the result of the map get(key) method.
  *
  * @param map  the map to decorate, must not be null
  * @param factory  the factory to use, must not be null
  * @throws IllegalArgumentException if map or factory is null
  */
 public static java.util.Map <Object, Object> decorate(java.util.Map <Object, Object> map, Factory factory)
 {
     if (factory == null)
     {
         throw new java.lang.IllegalArgumentException("Factory must not be null");
     }
     return(new DefaultedMap(map, FactoryTransformer.getInstance(factory)));
 }
        //-----------------------------------------------------------------------

        /**
         * Constructor that wraps (not copies).
         *
         * @param map  the map to decorate, must not be null
         * @param factory  the factory to use, must not be null
         * @throws IllegalArgumentException if map or factory is null
         */
        protected LazyMap(java.util.Map <Object, Object> map, Factory factory)
            : base(map)
        {
            if (factory == null)
            {
                throw new java.lang.IllegalArgumentException("Factory must not be null");
            }
            this.factory = FactoryTransformer.getInstance(factory);
        }
Example #3
0
 public List <string> GetAxis(string sp, object[] filter)
 {
     try
     {
         IConsultantReader <object, string> consultor = new ConsultantReader <object, string>();
         MapperManager <object, string>     mapper    = FactoryTransformer.Create <object, string>();
         List <string> response =
             consultor.ConsultarProcedimientoListObjArray(sp,
                                                          ConnectionString,
                                                          CommandType.StoredProcedure, filter, mapper);
         return(response);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
 public List <ParametersBO> GetParameters(object[] filter)
 {
     try
     {
         IConsultantReader <object, ParametersBO> consultor = new ConsultantReader <object, ParametersBO>();
         MapperManager <object, ParametersBO>     mapper    = FactoryTransformer.Create <object, ParametersBO>();
         List <ParametersBO> response =
             consultor.ConsultarProcedimientoListObjArray(ParametersSP,
                                                          ConnectionString,
                                                          CommandType.StoredProcedure, filter, mapper);
         return(response);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /**
  * Creates a Transformer that calls a Factory each time the transformer is used.
  * The transformer will return the value returned by the factory.
  *
  * @see org.apache.commons.collections.functors.FactoryTransformer
  *
  * @param factory  the factory to run each time in the transformer, not null
  * @return the transformer
  * @throws IllegalArgumentException if the factory is null
  */
 public static Transformer asTransformer(Factory factory)
 {
     return(FactoryTransformer.getInstance(factory));
 }