create model instance from the model class that read from the xml
configure.

@param formName
@return
@throws Exception
553974
private Object makeModelObject(String formName) {
		Object object = null;
		Class modelClass = null;
		try {
			modelClass = (Class) modelFactory.getModelClasses(formName);
			if (modelClass == null) {
				throw new Exception(" not found the model in config xml, formName=" + formName);
			}
			object = modelClass.newInstance();
			// inject
			modelProxyInjection.injectProperties(object);
		} catch (Exception e) {
			Debug.logError("[JdonFramework]--> call Model: " + modelClass + " error:" + e, module);
		}
		return object;
	}
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());
    }
973260
public function createForm($model, $formClass = null)
    {
        if (is_string($model)) {
            return $this->createFormInternal($model, new $model, $formClass);
        } else {
            return $this->createFormInternal(get_class($model), $model, $formClass);
        }
    }
1070150
protected Object fromXml(String xml, String tagName) throws Exception {
        Document document = XMLUtil.parseXMLFromString(xml);
        NodeList nodeList = document.getElementsByTagName(tagName);
        
        if (nodeList == null || nodeList.getLength() != 1) {
            throw new DOMException(DOMException.NOT_FOUND_ERR, "Top level tag '" + tagName + "' was not found.");
        }
        
        Element element = (Element) nodeList.item(0);
        Class<?> beanClass = getBeanClass(element);
        BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(beanClass);
        doParse(element, builder);
        DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
        factory.setParentBeanFactory(SpringUtil.getAppContext());
        AbstractBeanDefinition beanDefinition = builder.getBeanDefinition();
        factory.registerBeanDefinition(tagName, beanDefinition);
        return factory.getBean(tagName);
    }
1129135
@Override
    public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
        // JobPropertyDescriptors are bit different in that we allow them even without any user-visible configuration parameter,
        // so replace the lack of form data by an empty one. 
        if(formData.isNullObject()) formData=new JSONObject();

        return super.newInstance(req, formData);
    }
1161008
public Element createElement(String tagName) {
        return new Element(Tag.valueOf(tagName, ParseSettings.preserveCase), this.baseUri());
    }
1004526
public static Document createDomDocument() throws Exception
	{
	    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	    factory.setNamespaceAware(true);
	    DocumentBuilder builder = factory.newDocumentBuilder();

	    return builder.newDocument();
	}
4651
public ModelHandler borrowtHandlerObject(String formName) {
		ModelHandler modelHandler = null;
		try {
			modelHandler = handlerObjectFactory.borrowHandlerObject(formName);
			modelHandler.setModelMapping(modelFactory.getModelMapping(formName));
		} catch (Exception ex) {
			Debug.logError("[JdonFramework]can't get the modelHandler for the formName " + formName, module);
			returnHandlerObject(modelHandler);
		}
		return modelHandler;
	}
173046
public static ActionForm lookupActionForm(HttpServletRequest request, String formName) {
		ActionForm actionForm = null;
		actionForm = (ActionForm) request.getAttribute(formName);
		if (actionForm == null && request.getSession(false) != null) {
			HttpSession session = request.getSession(false);
			actionForm = (ActionForm) session.getAttribute(formName);
		}
		return actionForm;
	}
812827
public static Object createInstance(String className)
    {
        //get type
        Class<?> type=ReflectionHelper.getType(className);

        //create instance
        Object instance=ReflectionHelper.createInstance(type);
        
        return instance;
    }
218315
private static void createFactoryInstance() throws Exception {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createFactoryInstance");
    try {
      Class cls = Class.forName(MfpConstants.JS_JMS_MESSAGE_FACTORY_CLASS);
      instance = (JsJmsMessageFactory) cls.newInstance();
    }
    catch (Exception e) {
      FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.JsJmsMessageFactory.createFactoryInstance", "133");
      SibTr.error(tc,"UNABLE_TO_CREATE_JMSFACTORY_CWSIF0011",e);
      throw e;
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createFactoryInstance");
  }
822169
public PMML loadModel(String model, InputStream source) {
        try {
            if (schema == null) {
                visitorBuildResults.add(new PMMLWarning(ResourceFactory.newInputStreamResource(source), "Could not validate PMML document, schema not available"));
            }
            final JAXBContext jc;
            final ClassLoader ccl = Thread.currentThread().getContextClassLoader();
            XMLStreamReader reader = null;
            try {
                Thread.currentThread().setContextClassLoader(PMML4Compiler.class.getClassLoader());
                Class c = PMML4Compiler.class.getClassLoader().loadClass("org.dmg.pmml.pmml_4_2.descr.PMML");
                jc = JAXBContext.newInstance(c);
                XMLInputFactory xif = XMLInputFactory.newFactory();
                xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
                xif.setProperty(XMLInputFactory.SUPPORT_DTD, true);
                reader = xif.createXMLStreamReader(source);
			} finally {
                Thread.currentThread().setContextClassLoader(ccl);
            }
            Unmarshaller unmarshaller = jc.createUnmarshaller();
            if (schema != null) {
                unmarshaller.setSchema(schema);
            }

            if (reader != null) {
                return (PMML) unmarshaller.unmarshal(reader);
            } else {
            	this.results.add(new PMMLError("Unknown error in PMML"));
            	return null;
            }
        } catch (ClassNotFoundException | XMLStreamException | JAXBException e) {
            this.results.add(new PMMLError(e.toString()));
            return null;
        }
    }
481485
public static <T> T createInstanceByElement(XMLStreamReader reader, Class<T> clazz, Set<String> attrNames) {
        if (reader == null || clazz == null || attrNames == null)
            return null;

        try {
            T instance = clazz.newInstance();

            int count = reader.getAttributeCount();
            int matchCount = attrNames.size();

            for (int i = 0; i < count && matchCount > 0; ++i) {
                String name = reader.getAttributeLocalName(i);
                String value = reader.getAttributeValue(i);

                if (attrNames.contains(name)) {
                    Field field = clazz.getDeclaredField(name);
                    field.setAccessible(true);
                    field.set(instance, value);
                    matchCount--;
                }
            }
            return instance;
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (SecurityException e) {
            throw new RuntimeException(e);
        } catch (NoSuchFieldException e) {
            throw new RuntimeException(e);
        }
    }
1050280
public function getFormConfiguration($objectName, $formName)
    {
        $modelConfiguration = $this->getModelConfiguration($objectName);
        if (isset($modelConfiguration['forms'][$formName])) {
            $formConfiguration = $modelConfiguration['forms'][$formName];
            foreach ($formConfiguration['fields'] as $i => $formField) {
                $fieldConfiguration = $this->getField($objectName, $formField['name'], false);
                if (isset($fieldConfiguration['form_defaults'])) {
                    $formConfiguration['fields'][$i] = array_replace_recursive($fieldConfiguration['form_defaults'], $formField);
                }
            }

            usort($formConfiguration['fields'], array($this, 'sortByLocation'));

            return $formConfiguration;
        }
    }
113382
private Class<?> instantiate(String className) {
    try {
      return Class.forName(className, false, Thread.currentThread().getContextClassLoader());
    } catch (Throwable t) {
      try {
        serializer.serialize(
            new SuiteFailureEvent(
                new Failure(Description.createSuiteDescription(className), t)));
        if (flushFrequently)
          serializer.flush();
      } catch (Exception e) {
        warn("Could not report failure back to master.", t);
      }
      return null;
    }
  }
1097305
public static FormInputHandler create() {
		return new FormInputHandler(WebElementFinder.create().noLogging(true), null, null, null, null, null, null, null, null);
	}
900064
protected SimpleOutputElement createChild(String localName)
    {
        /* At this point we can also discard attribute Map; it is assumed
         * that when a child element has been opened, no more attributes
         * can be output.
         */
        mAttrSet = null;
        return new SimpleOutputElement(this, null, localName,
                                       mDefaultNsURI, mNsMapping);
    }