获得一个空闲的ModelHandler 如果空闲池没有，就重新生成指定个数的ModelHandler实例。 获得成功，则记入在用池。
当客户端调用完毕，调用returnHandlerObject返回该ModelHandler实例备重用。

@param formName
@return
@throws java.lang.Exception
547215
public ModelHandler borrowHandlerObject(String formName) {
		ModelHandler modelHandler = null;
		try {
			modelHandler = makeHandlerObject(formName);
		} catch (Exception e) {
			Debug.logError("[JdonFramework]borrowHandlerObject error:" + e, module);
		}
		/**
		 * ModelHandler modelHandler = null; try { String poolKey =
		 * (modelHandlerClassBuilder.getModelMapping(formName)).getHandler();
		 * 
		 * LinkedList listFree = (LinkedList) handlerFreePool.get(poolKey); if
		 * ((listFree == null) || (listFree.isEmpty())) { // 如果空了，生产 listFree =
		 * makeHandlerObjects(formName); handlerFreePool.put(poolKey, listFree);
		 * } modelHandler = (ModelHandler) listFree.removeFirst();
		 * 
		 * // 加入已经用的池 LinkedList listUsed = (LinkedList)
		 * handlerUsedPool.get(poolKey); if (listUsed == null) { listUsed = new
		 * LinkedList(); handlerUsedPool.put(poolKey, listUsed); }
		 * listUsed.add(modelHandler);
		 * 
		 * Debug.logVerbose("[JdonFramework]--> borrow Modelhandler instance " +
		 * poolKey + listFree.size() + " for " + formName, module); } catch
		 * (Exception e) {
		 * Debug.logError("[JdonFramework]borrowHandlerObject error:" + e,
		 * module); }
		 **/
		return modelHandler;
	}
12412
public static function createForModelName($modelName)
    {
        if (!class_exists($modelName)) {
            throw new \Parable\ORM\Exception("Model '{$modelName}' does not exist.");
        }
        return self::createForModel($modelName::create());
    }
302885
public ActionForm getFirstOutputForm( HttpServletRequest request )
    {
        if ( _outputForms == null || _outputForms.size() == 0 )
        {
            if ( _outputFormBeanType != null )
            {
                try
                {
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "Creating form bean of type " + _outputFormBeanType );
                    }
                    
                    ServletContext servletContext = InternalUtils.getServletContext( request );
                    ReloadableClassHandler rch = Handlers.get( servletContext ).getReloadableClassHandler();
                    Object formBean = rch.newInstance( _outputFormBeanType );
                    ActionForm wrappedFormBean = InternalUtils.wrapFormBean( formBean );
                    addOutputForm( wrappedFormBean );
                    return wrappedFormBean;
                }
                catch ( Exception e )
                {
                    _log.error( "Could not create form bean instance of " + _outputFormBeanType, e );
                }                
            }
            
            return null;
        }
        else
        {
            return ( ActionForm ) _outputForms.get( 0 );
        }
    }
813095
protected function getModel($model_name, $id, FormModel $form)
    {
        /*
         * We need to grab the model from the config and select one entry for
         * that model from within the database.
         */
        $model = $this->findModel($model_name, $id);
        /*
         * Here we generate the form to update the model using the kregel/formmodel
         * package
         */
        $form = $form->using(config('kregel.formmodel.using.framework'))
                            ->withModel($model)
                            ->submitTo(route('warden::api.update-model', [$model_name, $model->id]));
        $form_info = $form->form([
            'method'  => 'post',
            'enctype' => 'multipart/form-data',
        ]);

        return view('warden::view-model')
                ->with('form', $form_info)
                ->with('model_name', $model_name)
                ->with('vue_components', $form->vue_components);
    }
339820
@GetMapping(path = CasProtocolConstants.ENDPOINT_VALIDATE)
    protected ModelAndView handle(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
        return super.handleRequestInternal(request, response);
    }
276563
public static function makeFormRequestName($modelName)
    {
        $name = self::getProperCaseFor($modelName, 'request-form-name');
        $case = ucfirst(camel_case($name));

        if (!empty($postFix = Config::getFormRequestNamePostFix())) {
            return str_finish($case, $postFix);
        }

        return $case;
    }
943946
def _get_form_or_formset(self, request, obj, **kwargs):
        
        if self.exclude is None:
            exclude = []
        else:
            exclude = list(self.exclude)
        exclude.extend(self.get_readonly_fields(request, obj))
        if not self.exclude and hasattr(self.form, '_meta') and self.form._meta.exclude:
            # Take the custom ModelForm's Meta.exclude into account only if the
            # ModelAdmin doesn't define its own.
            exclude.extend(self.form._meta.exclude)
        # If exclude is an empty list we pass None to be consistant with the
        # default on modelform_factory
        exclude = self.replace_orig_field(exclude) or None
        exclude = self._exclude_original_fields(exclude)
        kwargs.update({'exclude': exclude})

        return kwargs
1122349
private synchronized LinkedList makeHandlerObjects(String formName) throws Exception {
		Debug.logVerbose("[JdonFramework]--> create Modelhandler instance " + poolSize, module);
		int count = 0;
		ModelHandler modelHandler = null;
		LinkedList list = new LinkedList();
		while (count < poolSize) {
			modelHandler = makeHandlerObject(formName);
			list.add(modelHandler);
			count++;
		}
		return list;
	}
388400
def get_form(self, form_class=None):
        """"""
        form = super().get_form(form_class)
        if self._save:
            make_form_or_formset_fields_not_required(form)
        return form
198664
@Deprecated
    public static <T extends RepositoryBrowser>
    T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException {
        List<Descriptor<RepositoryBrowser<?>>> list = filter(type);
        String value = req.getParameter(fieldName);
        if(value==null || value.equals("auto"))
            return null;

        // TODO: There was a TODO in the original code, which presumes passing something meaningful to the newInstance() JSON param
        // Now we just pass empty JSON in order to make the code compliant with the defined interface
        final JSONObject emptyJSON = new JSONObject();
        return type.cast(list.get(Integer.parseInt(value)).newInstance(req, emptyJSON));
    }
1172967
def _get_model_form_field(model, name, formfield_callback=None, **kwargs):
    
    field = model._meta.get_field(name)
    if not field.editable:  # see fields_for_model() logic in Django.
        return None

    # Apply admin formfield_overrides
    if formfield_callback is None:
        formfield = field.formfield(**kwargs)
    elif not callable(formfield_callback):
        raise TypeError('formfield_callback must be a function or callable')
    else:
        formfield = formfield_callback(field, **kwargs)

    return formfield
1271693
public ShapeHandler getShapeHandler() throws ShapefileException {
    ShapeHandler handler;
    switch (id) {
      case 1: case 11: case 21:
        handler = new PointHandler(this);
        break;
      case 3: case 13: case 23:
        handler = new MultiLineHandler(this);
        break;
      case 5: case 15: case 25:
        handler = new PolygonHandler(this);
        break;
      case 8: case 18: case 28:
        handler = new MultiPointHandler(this);
        break;
      default:
        handler = null;
    }
    return handler;
  }
1241863
public static ExceptionHandler getDefaultExceptionHandler(String dbName) {
        ExceptionHandler result = null;
        Constructor<?> constructor = null;

        Class<?> clazz = instance().defaultExceptionHandler;

        try {
            constructor = clazz.getConstructor(String.class);
            result = (ExceptionHandler) constructor.newInstance(dbName);
        } catch (SecurityException e) {
            throw new MjdbcRuntimeException(ERROR_TH_INIT_FAILED, e);
        } catch (NoSuchMethodException e) {
            throw new MjdbcRuntimeException(ERROR_TH_INIT_FAILED, e);
        } catch (IllegalArgumentException e) {
            throw new MjdbcRuntimeException(ERROR_TH_INIT_FAILED, e);
        } catch (InstantiationException e) {
            throw new MjdbcRuntimeException(ERROR_TH_INIT_FAILED, e);
        } catch (IllegalAccessException e) {
            throw new MjdbcRuntimeException(ERROR_TH_INIT_FAILED, e);
        } catch (InvocationTargetException e) {
            throw new MjdbcRuntimeException(ERROR_TH_INIT_FAILED, e);
        }

        return result;
    }
1097305
public static FormInputHandler create() {
		return new FormInputHandler(WebElementFinder.create().noLogging(true), null, null, null, null, null, null, null, null);
	}
1082725
public static synchronized FormInputValueHelper getInstance(
			InputSpecification inputSpecification, FormFillMode formFillMode) {
		if (instance == null)
			instance = new FormInputValueHelper(inputSpecification,
					formFillMode);
		return instance;
	}
58241
public static String getClearHiddenCommandFormParamsFunctionName(
            String formName)
    {
        final char separatorChar = FacesContext.getCurrentInstance().getNamingContainerSeparatorChar();
        if (formName == null)
        {
            return "'" + HtmlRendererUtils.CLEAR_HIDDEN_FIELD_FN_NAME
                    + "_'+formName.replace(/-/g, '\\$" + separatorChar
                    + "').replace(/" + separatorChar + "/g,'_')";
        }

        return JavascriptUtils
                .getValidJavascriptNameAsInRI(HtmlRendererUtils.CLEAR_HIDDEN_FIELD_FN_NAME + "_"
                        + formName.replace(separatorChar, '_'));
    }
206783
public static Object unwrapFormBean( ActionForm form )
    {
        if ( form == null ) return null;

        if ( form instanceof AnyBeanActionForm )
        {
            return ( ( AnyBeanActionForm ) form ).getBean();
        }

        return form;
    }