當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。