Fill {@code classModel} data-model bean, with the content of
{@code clazz}.

@param classModel
the data-model to fill
498182
@Override
    public void fill(ClassModel classModel) {

        /**
         * FreeMarker function availlable inside templates to add dependencies
         * for the class.
         */
        class AddDependencies implements TemplateMethodModelEx {

            ClassType model;

            public AddDependencies(ClassType model) {
                this.model = model;
            }

            @Override
            @SuppressWarnings("rawtypes")
            public Object exec(List arguments) throws TemplateModelException {
                if (arguments.size() < 1) {
                    throw new TemplateModelException("addDependencies need at least one parameter.");
                }
                for (Object argument : arguments) {
                    Object dependency = DeepUnwrap.unwrap((TemplateModel) argument);
                    if (dependency instanceof String) {
                        addDependency(context.getClassModel((String) dependency));
                    } else if (dependency instanceof ClassModel) {
                        addDependency((ClassModel) dependency);
                    } else if (dependency instanceof Collection) {
                        for (Object depend : (Collection) dependency) {
                            addDependency((ClassModel) depend);
                        }
                    } else if (dependency != null) {
                        throw new TemplateModelException(
                                "addDependencies arguments must be a class name, a ClassModel instance or a Collection of ClassModels.");
                    }
                }
                return "";
            }

            private void addDependency(ClassModel classModel) {
                model.getDependencies().add(classModel);
            }
        }

        /**
         * FreeMarker function availlable inside templates to add includes file
         * for the class.
         */
        class AddIncludes implements TemplateMethodModelEx {

            ClassType model;

            public AddIncludes(ClassType model) {
                this.model = model;
            }

            @Override
            @SuppressWarnings({ "rawtypes", "unchecked" })
            public Object exec(List arguments) throws TemplateModelException {
                if (arguments.size() < 1) {
                    throw new TemplateModelException("addIncludes need at least one parameter.");
                }
                for (Object argument : arguments) {
                    Object include = DeepUnwrap.unwrap((TemplateModel) argument);
                    if (include instanceof String) {
                        model.getIncludes().add((String) include);
                    } else if (include instanceof Collection) {
                        model.getIncludes().addAll((Collection) include);
                    } else if (include != null) {
                        throw new TemplateModelException("addIncludes arguments must be a String or a Collection of Strings.");
                    }
                }
                return "";
            }
        }

        ClassType typeModel = classModel.getType();
        Class<?> clazz = typeModel.getClazz();

        StringBuilder fullName = new StringBuilder();
        String shortName = "";
        String sep = "";
        for (String namespace : mappings.getNamespace(clazz)) {
            fullName.append(sep).append(namespace);
            sep = "::";
            shortName = namespace;
        }
        typeModel.setCppFullName(fullName.toString());
        typeModel.setCppShortName(shortName);

        typeModel.setOwner(typeModel.isIsInnerClass() ? context.getClassModel(clazz.getDeclaringClass()) : classModel);
        if (clazz.isArray()) {
            typeModel.setInnerType(context.getClassModel(clazz.getComponentType()));
            Class<?> finalClazz = clazz;
            while (finalClazz.getComponentType() != null) {
                finalClazz = finalClazz.getComponentType();
            }
            typeModel.setFinalInnerType(context.getClassModel(finalClazz));
        }

        typeModel.setJavaSignature(Datatype.getJavaSignature(clazz));
        typeModel.setJniSignature(Datatype.getJNISignature(clazz));
        typeModel.setJniMethodName(Datatype.getJNIMethodName(clazz));
        typeModel.setAddIncludes(new AddIncludes(typeModel));
        typeModel.setAddDependencies(new AddDependencies(typeModel));
    }
1140828
public void addDataModelListener(DataModelListener listener) {

        if (listener == null) {
            throw new NullPointerException();
        }
        if (listeners == null) {
            //noinspection CollectionWithoutInitialCapacity
            listeners = new ArrayList<DataModelListener>();
        }
        listeners.add(listener);

    }
626727
public void addMetadata( final Model model )
    {
        final Resource datasetId = model.createResource( getDatasetURI() );
        final Resource fragmentId = model.createResource( fragmentURL );

        datasetId.addProperty( CommonResources.RDF_TYPE, CommonResources.VOID_DATASET );
        datasetId.addProperty( CommonResources.RDF_TYPE, CommonResources.HYDRA_COLLECTION );
        datasetId.addProperty( CommonResources.VOID_SUBSET, fragmentId );
        
        Literal itemsPerPage = model.createTypedLiteral(this.getMaxPageSize());
        datasetId.addProperty( CommonResources.HYDRA_ITEMSPERPAGE, itemsPerPage);

        fragmentId.addProperty( CommonResources.RDF_TYPE, CommonResources.HYDRA_COLLECTION );
        fragmentId.addProperty( CommonResources.RDF_TYPE, CommonResources.HYDRA_PAGEDCOLLECTION );
    }
419548
public static void initializeClass(Class clazz) {
		try {
			Class.forName(clazz.getName(), true, Thread.currentThread().getContextClassLoader());
		}
		catch (ClassNotFoundException e) {
			throw new RuntimeException(e);
		}
	}
1321930
@Override
    public T addClass(Class<?> clazz) throws IllegalArgumentException {
        Validate.notNull(clazz, "Clazz must be specified");

        return addClasses(clazz);
    }
77926
public static void resetModelClass() {
		ModelFactory.modelClass = DefaultModelImpl.class;
    	System.err.println("[INFO] Reset model-class: " + ModelFactory.modelClass.getName());
	}
1353971
public void addFilterModel(final FilterModel model) {
		if (model.getUrlPatterns() != null) {
			try {
				filterLock.writeLock().lock();
				associateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle());
				for (String virtualHost : resolveVirtualHosts(model)) {
					for (String urlPattern : model.getUrlPatterns()) {
							final UrlPattern newUrlPattern = new UrlPattern(getFullPath(model.getContextModel(), urlPattern),
											model);
							String fullPath = getFullPath(model.getContextModel(), urlPattern);
							if (filterUrlPatterns.get(virtualHost) == null) {
								filterUrlPatterns.put(virtualHost, new ConcurrentHashMap<>());
							}
							Set<UrlPattern> urlSet = filterUrlPatterns.get(virtualHost).get(fullPath);
							if (urlSet == null) {
									//initialize first
									urlSet = new HashSet<>();
							}
							urlSet.add(newUrlPattern);
							filterUrlPatterns.get(virtualHost).put(fullPath, urlSet);
    //					final UrlPattern existingPattern = filterUrlPatterns.putIfAbsent(
    //							getFullPath(model.getContextModel(), urlPattern), newUrlPattern);
    //					if (existingPattern != null) {
    //						// this should never happen but is a good assertion
    //						LOG.error("Internal error (please report): Cannot associate url mapping "
    //								+ getFullPath(model.getContextModel(), urlPattern) + " to " + newUrlPattern
    //								+ " because is already associated to " + existingPattern);
    //					}
                                    }
                                }
			} finally {
				filterLock.writeLock().unlock();
			}
		}
	}
261261
private void addAnnotation(final Class<? extends Annotation> clazz) {
        final List<? extends Annotation> annotations = ReflectionUtils.getAnnotations(getClazz(), clazz);
        for (final Annotation ann : annotations) {
            addAnnotation(clazz, ann);
        }
    }
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;
        }
    }
649587
@Override
	public void setModel(final WebComponent component, final WebModel model) {
		map.put(component, model);
	}
796205
public void addCache(Object key, String className, Object model) {
		if (key == null)
			return;
		if (ModelUtil.isModel(model.getClass()))
			modelCacheManager.saveCache(key, className, model);
		else
			Debug.logError("addCache error:" + model.getClass() + " not ModelIF or @Model", module);

	}
1205887
@Override public void setModel(TableModel model)
   {
      super.setModel(model);
      int columns = model.getColumnCount();
      TableColumnModel tableColumnModel = getColumnModel();
      for (int index = 0; index < columns; index++)
      {
         tableColumnModel.getColumn(index).setPreferredWidth(m_columnWidth);
      }
   }
930824
public void add(final Class<?> clazz) {
		if (this.clazzes.contains(clazz)) {
			throw new IllegalArgumentException(
					"Only one class-instance per benchmark allowed");
		} else {
			this.clazzes.add(clazz);
		}
	}
393959
private static TableModel entity2ModelWithConfig(Class<?> entityClass) {
		TableModel model;
		model = entity2ModelIgnoreConfigMethod(entityClass);
		Method method = null;
		try {
			method = entityClass.getMethod("config", TableModel.class);
		} catch (Exception e) {// NOSONAR
		}
		if (method != null)
			try {
				method.invoke(null, model);
			} catch (Exception e) {
				throw new DialectException(e);
			}
		if (model == null)
			throw new DialectException("Can not create TableModel for entityClass " + entityClass);
		return model;
	}
470309
public void addAnnotation(final Class<? extends Annotation> clazz) {
        if (field.isAnnotationPresent(clazz)) {
            addAnnotation(clazz, field.getAnnotation(clazz));
        }
    }
781743
public void setTableModel(final TableModel tableModel) {
		getOrCreateComponentModel().tableModel = tableModel;
		getOrCreateComponentModel().rowIndexMapping = null;
		setSelectedRows(null);
		setExpandedRows(null);
		clearPrevExpandedRows();
		clearPrevRenderedRows();

		if (tableModel instanceof BeanBoundTableModel) {
			((BeanBoundTableModel) tableModel).
					setBeanProvider(new BeanBoundTableModelBeanProvider(this));
			((BeanBoundTableModel) tableModel).setBeanProperty(".");
		}

		if (tableModel instanceof ScrollableTableModel) {
			if (!isPaginated()) {
				throw new IllegalStateException(
						"Set a ScrollableTableModel on a table that is not paginated.");
			}

			int startIndex = getCurrentPage() * getRowsPerPage();
			int endIndex = startIndex + getRowsPerPage() - 1;
			((ScrollableTableModel) tableModel).setCurrentRows(startIndex, endIndex);
		}

		// Flush the repeater's row contexts and scratch maps
		repeater.reset();
	}
1259590
public void putClass(String key, Class<?> clazz) {
		checkNotNull(key);
		checkNotNull(clazz);
		final String error = InstantiationUtil.checkForInstantiationError(clazz);
		if (error != null) {
			throw new ValidationException("Class '" + clazz.getName() + "' is not supported: " + error);
		}
		put(key, clazz.getName());
	}