create a new ADictionary instance

@param     _class
@return    ADictionary
359369
public static ADictionary createDictionary(
            Class<? extends ADictionary> _class, Class<?>[] paramType, Object[] args)
    {
        try {
            Constructor<?> cons = _class.getConstructor(paramType);
            return ( ( ADictionary ) cons.newInstance(args) );
        } catch ( Exception e ) {
            System.err.println("can't create the ADictionary instance " +
                    "with classpath ["+_class.getName()+"]");
            e.printStackTrace();
        }
        
        return null;
    }
1032529
public function createFromArray($class, array $attributes)
    {
        $entity = new $class();
        foreach ($attributes as $name => $value) {
            if (property_exists($entity, $name)) {
                $methodName = $this->getSetterName($entity, $name);
                if ($methodName) {
                    $entity->{$methodName}($value);
                } else {
                    throw new InvalidPropertyException('Add/Setter method for property '.$name.' not found');
                }
            }
        }

        return $entity;
    }
234117
public final Cache2kBuilder<K, V> name(Class<?> _class) {
    config().setName(_class.getName());
    return this;
  }
557243
@SuppressWarnings("unchecked")
	public static <T> T newInstance(Class<?> aClass) 
	{
		if(aClass == null)
			return null;
		
				try
				{
					if(String.class.equals(aClass))
					{
						return (T)"";
					}
					else if(Integer.class.equals(aClass))
					{
						return (T)Integer.valueOf(0);
					}
					else if(Date.class.equals(aClass))
					{
						return (T)Calendar.getInstance().getTime();
					}				
					else if(Long.class.equals(aClass) ||
							long.class.equals(aClass))
					{
						return (T)Long.valueOf(0);
					}		
					else if(Character.class.equals(aClass) ||
							char.class.equals(aClass) )
					{
						return (T) Character.valueOf('\0');
					}
					else if(Float.class.equals(aClass) ||
							float.class.equals(aClass))
					{
						return (T)Float.valueOf(0);
					}
					else if(Double.class.equals(aClass) || 
						   double.class.equals(aClass))
					{
						return (T)Double.valueOf(0);
					}				
					
					Constructor<T> constructor = (Constructor<T>)aClass.getDeclaredConstructor();
					
					
					return (T)constructor.newInstance();
					
				}
				catch(IllegalAccessException e)
				{
					throw new SetupException("Trying to create "+aClass.getName()+" "+e.getMessage());
				}
				catch(NoSuchMethodException | InvocationTargetException | InstantiationException e)
				{
						//Get constructor
						Constructor<?>[] constructors = aClass.getConstructors();
							
						int len = constructors.length;
						for(int i=0; i < len; i++)
						{
							Class<?>[] parameterTypes = constructors[i].getParameterTypes();
						    
							if(parameterTypes == null || parameterTypes.length == 0)
								throw new SetupException("Trying to create "+aClass.getName()+" "+e.getMessage()); //has a default constructor but not able to create it
							
							//Construct arguments
							Object[] initargs = new Object[parameterTypes.length];
							
							for(int argsIndex=0; argsIndex <  initargs.length;argsIndex++)
							{
								initargs[argsIndex] = newInstance(parameterTypes[argsIndex]);
							}
							
							try
							{
								return (T)constructors[i].newInstance(initargs);
							}
							catch(Exception exception)
							{}
						}//end for constructors
						
						//not able to success use another constructor
						throw new SetupException("Trying to create class with name:"+aClass.getName()+" ERROR:"+e.getMessage());	
					}//end catch
			}
484584
public<T> Post<T> create(Class<T> cls) throws APIException {
		return new Post<T>(this,getDF(cls));
	}
116748
public <T> T create(Class<T> clazz) {
        return create(clazz, new Class<?>[]{}, new Object[]{});
    }
409834
public static function createInstanceList($parsed, $class)
    {
        $list = [];

        foreach ($parsed as $value) {
            $list[] = $class::create($value);
        }

        return $list;
    }
319130
public function createCard($contextualClass = Card::DEFAULT_CONTEXT, $inverse = false)
    {
        $card = new Card($contextualClass, $inverse);
        $this->childNodes->push($card);

        return $this->childNodes->last();
    }
677863
def create_class(self):
        
        if self.target_language in ['java', 'go']:
            n_indents = 1 if self.target_language == 'java' else 0
            class_head_temp = self.temp('separated.{}.class'.format(
                self.prefix), n_indents=n_indents, skipping=True)
            self.class_head = class_head_temp.format(**self.__dict__)

        return self.temp('separated.class').format(**self.__dict__)
946766
private function createAnnotationInstance($class, $attributes, AnnotationMetadata $metadata)
    {
        //instantiate annotation class
        if (is_array($metadata->constructor)) {
            $arguments = [];
            //$metadata->constructor has the constructor parameter names in order
            foreach ($metadata->constructor as $i => $key) {
                if (!isset($attributes[ $key ])) {
                    $arguments[ $key ] = $metadata->attributes[ $key ]->default;
                } else {
                    $arguments[ $key ] = $attributes[ $key ];
                    unset($attributes[ $key ]);
                }
            }
            $annotation = $this->getClassReflector($class)->newInstanceArgs($arguments);
        } else {
            $annotation = new $class;
        }

        foreach ($attributes as $key => $value) {
            if (isset($metadata->attributes[ $key ]->setter)) {
                $annotation->{$metadata->attributes[ $key ]->setter}($value);
            } else {
                $annotation->$key = $value;
            }
        }

        return $annotation;
    }
587997
public static function object(string $class = null) : ObjectType
    {
        if (!isset(self::$objects[$class])) {
            self::$objects[$class] = new ObjectType($class);
        }

        return self::$objects[$class];
    }
97648
public function create($class, array $options = array())
    {
        if (!is_subclass_of($class, Toolbar::class)) {
            throw new \InvalidArgumentException("Class '$class' must extends Toolbar class.");
        }

        /** @var Toolbar $toolbar */
        $toolbar = new $class($this->container);
        $resolver = new OptionsResolver();
        $toolbar->configureOptions($resolver);
        $resolvedOptions = $resolver->resolve($options);
        $toolbar->setOptions($resolvedOptions);

        // build Actions
        $actionsBuilder = new ActionsBuilder($this->container);
        $toolbar->buildActions($actionsBuilder, $resolvedOptions);
        $toolbar->actions = $actionsBuilder->getActions();

        // build form
        $formFactory = $this->container->get('form.factory');
        $formBuilder = $formFactory->createBuilder(FormType::class, null, $resolvedOptions['form_options']);
        $toolbar->buildForm($formBuilder, $resolvedOptions);
        $toolbar->form = $formBuilder->getForm();

        return $toolbar;
    }
1241903
public static <T> ClassSup<T> cls(Class<T> cls) {
                return mapper.get(cls.getName(), () -> new ClassSup<>(cls));
        }
281630
public static function model($class, $cache = false, $constructor_parameters = null) {
		// fix dot notation
		$class = str_replace('.', '_', $class);
		$hash = sha1($class . serialize($constructor_parameters));
		// if we need to override classes
		if (isset(\Overrides\Factory::$data[$class])) {
			$class = \Overrides\Factory::$data[$class];
		}
		// if we are not caching
		if (!$cache) goto no_cache;
		// try to find objects in the cache
		if (isset(self::$class_objects['model'][$hash])) {
			$object = & self::$class_objects['model'][$hash];
		} else {
no_cache:
			// process virtual models
			if (strpos($class, '0Virtual0') !== false) {
				if (isset($constructor_parameters)) {
					self::$class_objects['model'][$hash] = \Object\Virtual\Models::model($class, ... $constructor_parameters);
				} else {
					self::$class_objects['model'][$hash] = \Object\Virtual\Models::model($class);
				}
			} else {
				// if we need to pass options to an object
				$class_name = ltrim($class, '\\');
				if (isset($constructor_parameters)) {
					self::$class_objects['model'][$hash] = new $class_name(... $constructor_parameters);
				} else {
					self::$class_objects['model'][$hash] = new $class_name();
				}
			}
			$object = & self::$class_objects['model'][$hash];
		}
		return $object;
	}
1329908
public function create($class) {
        $reflectionClass = new ReflectionClass($class);
        $reflectionMethod = $reflectionClass->getConstructor();
        if (!$reflectionMethod) {
            return new $class;
        }
        $params = &$this->fetchDepsFromSignature($reflectionMethod);
        return $reflectionClass->newInstanceArgs($params);
    }
410508
public T create(final Class<T> klass) {
    T obj;
    try {
      obj = (T) klass.newInstance();
    }
    catch (IllegalAccessException e) {
      throw new DocrepException(e);
    }
    catch (InstantiationException e) {
      throw new DocrepException(e);
    }
    add(obj);
    return obj;
  }
619983
@NonNull
    public <T> List<T> create(@NonNull Collection<Class<? extends T>> classes) {
        final List<T> result = new ArrayList<>();
        for (Class<? extends T> clazz : classes) {
            final T instance = create(clazz);
            if (instance != null) {
                result.add(instance);
            }
        }
        return result;
    }