当前位置: 首页>>代码示例>>Java>>正文


Java JKObjectUtil类代码示例

本文整理汇总了Java中com.jk.util.JKObjectUtil的典型用法代码示例。如果您正苦于以下问题:Java JKObjectUtil类的具体用法?Java JKObjectUtil怎么用?Java JKObjectUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JKObjectUtil类属于com.jk.util包,在下文中一共展示了JKObjectUtil类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeQueryAsObjectList

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
@Override
public <T> List<T> executeQueryAsObjectList(Class<T> clas, String instanceProperyNames, String query, Object... params) {
	logger.debug(String.format("executeQueryAsObjectList, Class(%s), Properties(%s), Query(%s) , Params (%s)", clas.getSimpleName(),
			instanceProperyNames, query, Arrays.toString(params)));
	String[] properties = instanceProperyNames.split(JK.CSV_SEPARATOR);
	List<T> results = new Vector<>();
	Object[] rows = executeQueryAsArray(query, params);
	for (Object rowObject : rows) {
		Object[] row = (Object[]) rowObject;
		T instance = JKObjectUtil.newInstance(clas);
		for (int i = 0; i < row.length; i++) {
			JKObjectUtil.setPeopertyValue(instance, properties[i], row[i]);
		}
		results.add(instance);
	}
	return results;
}
 
开发者ID:kiswanij,项目名称:jk-db,代码行数:18,代码来源:JKAbstractPlainDataAccess.java

示例2: toString

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
@Override
public String toString() {
	List<JKColumnWrapper> columns = getColumns(getClass());
	StringBuffer buf = new StringBuffer();
	buf.append(getAliasName());
	buf.append("[");
	int i = 0;
	for (JKColumnWrapper column : columns) {
		if (!column.getFieldName().toLowerCase().contains("password")) {
			if (i++ > 0) {
				buf.append(",");
			}
			buf.append(column.name());
			buf.append("=");
			buf.append(JKObjectUtil.getPropertyValue(this, column.getFieldName()));
		}
	}
	buf.append("]\n");
	return buf.toString();
}
 
开发者ID:kiswanij,项目名称:jk-db,代码行数:21,代码来源:JKEntity.java

示例3: handleMapping

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
/**
 *
 * @param wrapper
 * @return
 */
protected void handleMapping(final JKTagWrapper wrapper) {
	if (JKFacesConfigurations.getInstance().isDecorateMapping()) {
		final JKFacesConfigurations config = JKFacesConfigurations.getInstance();

		final JKTagMapping mapping = config.findTagMapping(wrapper);
		if (mapping != null) {
			this.logger.debug("mapping found : ", JKObjectUtil.toString(mapping));
			final String nameSpaceLetter = mapping.getNameSpaceLetter();
			if (nameSpaceLetter != null) {
				final JKNamespace namespace = config.getNamespaceByLetter(nameSpaceLetter);
				wrapper.setNamespace(namespace.getUrl());
			}
			wrapper.setqName(mapping.getTargetQName());
			wrapper.setLocalName(mapping.getTargetLocalName());
		}
	}
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:23,代码来源:JKTagDecorator.java

示例4: createInput

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
/**
 * Creates a new JSFComponent object.
 *
 * @param label
 *            the label
 * @param type
 *            the type
 * @return the UI input
 */
public static UIInput createInput(final String label, final Class type) {
	UIInput input = null;
	if (JKObjectUtil.isTime(type)) {
		input = (javax.faces.component.UIInput) JSFComponentFactory.createComponent(TimePicker.COMPONENT_TYPE);
	} else if (JKObjectUtil.isTimeStamp(type)) {
		input = (javax.faces.component.UIInput) JSFComponentFactory.createComponent(Calendar.COMPONENT_TYPE);
	} else if (JKObjectUtil.isDate(type)) {
		input = (javax.faces.component.UIInput) JSFComponentFactory.createComponent(Calendar.COMPONENT_TYPE);
	} else if (JKObjectUtil.isBoolean(type)) {
		input = (javax.faces.component.UIInput) JSFComponentFactory.createComponent(SelectBooleanCheckbox.COMPONENT_TYPE);
	} else {
		input = JSFComponentFactory.createInputText(null);
	}
	input.getAttributes().put("label", label);
	return input;
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:26,代码来源:JSFComponentFactory.java

示例5: registerHanders

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
/**
	 * Register handers.
	 *
	 * @param packageString
	 *            the package string
	 */
	public void registerHanders(String packageString) {
		List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString);
		for (String handler : list) {
//			System.out.println(handler);						
			JKExceptionHandler<? extends Throwable> newInstance = JKObjectUtil.newInstance(handler);
			Class<? extends Throwable> clas = JKObjectUtil.getGenericParamter(handler);
			setHandler(clas, newInstance);
		}
	}
 
开发者ID:kiswanij,项目名称:jk-util,代码行数:16,代码来源:JKExceptionHandlerFactory.java

示例6: main

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
/**
 * The main method.
 *
 * @param args
 *            the arguments
 */
public static void main(final String[] args) {
	final JKFacesConfigurations test = getInstance();
	final List<JKNamespace> namespaces = test.getNamespaces();
	for (final JKNamespace ns : namespaces) {
		System.out.println(ns.getPrefix() + ", " + ns.getUrl());
	}
	System.out.println("----------------");
	final List<JKTagMapping> tagMapping2 = test.getTagMapping();
	for (final JKTagMapping tagMapping : tagMapping2) {
		System.out.println(JKObjectUtil.toString(tagMapping));
	}
	System.out.println("Done");
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:20,代码来源:JKFacesConfigurations.java

示例7: afterUnmarshal

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
void afterUnmarshal(final Unmarshaller u, final Object parent) {
	loadAllNamesSpacesFromJsfContainer();
	Collections.sort(this.tagMapping);
	System.err.println("---------------------------------------------");
	logger.debug("All tags mappings:");
	System.err.println("---------------------------------------------");
	for (final JKTagMapping mapping : this.tagMapping) {
		logger.debug(JKObjectUtil.toString(mapping));
	}
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:11,代码来源:JKFacesConfigurations.java

示例8: loadAllNamesSpacesFromJsfContainer

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
protected void loadAllNamesSpacesFromJsfContainer() {
	logger.debug("loadAllNamesSpacesFromJsfContainer....");
	// HashMap<String, Object> publicNameSpaces = new HashMap<>();
	final ApplicationAssociate currentInstance = ApplicationAssociate.getCurrentInstance();
	if (currentInstance != null) {
		final Compiler instance = currentInstance.getCompiler();
		logger.debug("loading libraries from JSF compiler");
		final List libraries = JKObjectUtil.getFieldValue(Compiler.class, instance, "libraries");
		for (final Object libObject : libraries) {
			if (libObject instanceof AbstractTagLibrary) {
				final AbstractTagLibrary library = (AbstractTagLibrary) libObject;
				logger.debug(String.format("fetching %s library", library.getNamespace()));
				// load components using reflection
				final Map map = JKObjectUtil.getFieldValue(AbstractTagLibrary.class, library, "factories");
				final JKNamespace namespace = getNameSpaceByUrl(library.getNamespace(), true);

				final Set keySet = map.keySet();
				for (final Object object : keySet) {
					// add tag names
					final String localName = object.toString();
					final String qName = namespace.getLetter().concat(":").concat(localName);
					// check if mapping already exists
					if (findTagMapping(qName) == null) {
						final JKTagMapping mapping = new JKTagMapping(localName, qName, namespace);
						this.tagMapping.add(mapping);
					}
				}
			}
		}
	}
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:32,代码来源:JKFacesConfigurations.java

示例9: executeQueryAsSingleObject

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
@Override
public <T> T executeQueryAsSingleObject(Class<T> clas, String query, Object... params) {
	return executeQueryAsSingleObject(clas, JKObjectUtil.getInstanceVariables(clas), query, params);
}
 
开发者ID:kiswanij,项目名称:jk-db,代码行数:5,代码来源:JKAbstractPlainDataAccess.java

示例10: getIdValue

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
/**
 * Gets the id value.
 *
 * @param <T>
 *            the generic type
 * @return the id value
 */
public <T> T getIdValue() {
	return JKObjectUtil.getPropertyValue(this, this.getIdColumn().getFieldName());
}
 
开发者ID:kiswanij,项目名称:jk-db,代码行数:11,代码来源:JKEntity.java

示例11: setGui

import com.jk.util.JKObjectUtil; //导入依赖的package包/类
/**
 * Sets the gui.
 *
 * @param gui
 *            the new gui
 */
public void setGui(final Object gui) {
	setGui(JKObjectUtil.toXml(gui));
}
 
开发者ID:kiswanij,项目名称:jk-util,代码行数:10,代码来源:JKAudit.java


注:本文中的com.jk.util.JKObjectUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。