當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyUtils.isReadable方法代碼示例

本文整理匯總了Java中org.apache.commons.beanutils.PropertyUtils.isReadable方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyUtils.isReadable方法的具體用法?Java PropertyUtils.isReadable怎麽用?Java PropertyUtils.isReadable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.beanutils.PropertyUtils的用法示例。


在下文中一共展示了PropertyUtils.isReadable方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processarValorsFiltre

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
private Map<String, Object> processarValorsFiltre(
		Object filtreCommand,
		List<TascaDadaDto> dadesFiltre,
		Map<String, Object> valors) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
	Map<String, Object> valorsPerService = new HashMap<String, Object>();
	for (TascaDadaDto dada: dadesFiltre) {
		String clau = (dada.getDefinicioProcesKey() == null) ? dada.getVarCodi() : dada.getDefinicioProcesKey() + "." + dada.getVarCodi();
		clau = clau.replace(
				ExpedientCamps.EXPEDIENT_PREFIX_JSP,
				ExpedientCamps.EXPEDIENT_PREFIX);
		if (CampTipusDto.BOOLEAN.equals(dada.getCampTipus()) && PropertyUtils.isReadable(filtreCommand, dada.getVarCodi())) {
			Boolean valor = (Boolean) PropertyUtils.getSimpleProperty(
					filtreCommand,
					dada.getVarCodi());
			valors.put(
					dada.getVarCodi(),
					valor);
		}
		valorsPerService.put(
				clau,
				valors.get(dada.getVarCodi()));
	}
	return valorsPerService;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:25,代碼來源:ExpedientConsultaInformeController.java

示例2: copyBeanNotNull2Bean

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
/**
 * 對象拷貝 數據對象空值不拷貝到目標對象
 * 
 * @param databean 待拷貝對象
 * @param tobean 目標對象
 * @throws NoSuchMethodException
 */
public static void copyBeanNotNull2Bean(Object databean, Object tobean) throws Exception {
	PropertyDescriptor origDescriptors[] = PropertyUtils.getPropertyDescriptors(databean);
	for (int i = 0; i < origDescriptors.length; i++) {
		String name = origDescriptors[i].getName();
		// String type = origDescriptors[i].getPropertyType().toString();
		if ("class".equals(name)) {
			continue; // No point in trying to set an object's class
		}
		if (PropertyUtils.isReadable(databean, name) && PropertyUtils.isWriteable(tobean, name)) {
			try {
				Object value = PropertyUtils.getSimpleProperty(databean, name);
				if (value != null) {
					getInstance().setSimpleProperty(tobean, name, value);
				}
			} catch (java.lang.IllegalArgumentException ie) {
				; // Should not happen
			} catch (Exception e) {
				; // Should not happen
			}

		}
	}
}
 
開發者ID:tzou24,項目名稱:abina-common-util,代碼行數:31,代碼來源:ParamsUtils.java

示例3: get

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
public default Object get(Object key) {
    try {
        if (PropertyUtils.isReadable(this, key.toString())) {

            return PropertyUtils.getProperty(this, key.toString());
        }

        return getAttributes().get(key);
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
}
 
開發者ID:StallionCMS,項目名稱:stallion-core,代碼行數:13,代碼來源:MappedModel.java

示例4: getFieldValue

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
public static Object getFieldValue(Object obj, String fieldName) {
    Object propertyValue = null;
    try {
        if (PropertyUtils.isReadable(obj, fieldName)) {
            propertyValue = PropertyUtils.getProperty(obj, fieldName);
        }
    } catch (Exception e) {
        logger.error("獲取成員變量出錯!", e);
        throw new RuntimeException(e);
    }
    return propertyValue;
}
 
開發者ID:thinkhoon,項目名稱:tkhoon,代碼行數:13,代碼來源:ObjectUtil.java

示例5: getValorsPerService

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
@SuppressWarnings("static-access")
private Map<String, Object> getValorsPerService(Object filtreCommand, List<TascaDadaDto> camps, Map<String, Object> valors) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
	Map<String, Object> valorsPerService = new HashMap<String, Object>();
	for (TascaDadaDto camp : camps) {
		String clau = (camp.getDefinicioProcesKey() == null) ? camp.getVarCodi() : camp.getDefinicioProcesKey() + "." + camp.getVarCodi();
		clau = camp.getVarCodi().replace(ExpedientCamps.EXPEDIENT_PREFIX_JSP, ExpedientCamps.EXPEDIENT_PREFIX);
		if (camp.getCampTipus().BOOLEAN.equals(camp.getCampTipus()) && PropertyUtils.isReadable(filtreCommand, camp.getVarCodi())) {
			Boolean valor = (Boolean) PropertyUtils.getSimpleProperty(filtreCommand, camp.getVarCodi());
			valors.put(camp.getVarCodi(), valor);
		}
		valorsPerService.put(clau, valors.get(camp.getVarCodi()));
	}
	return valorsPerService;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:15,代碼來源:ExpedientInformeController.java

示例6: copyProperties

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void copyProperties(Object dest, Object orig) throws IllegalAccessException, InvocationTargetException {
    PropertyDescriptor[] origDescriptors =
            PropertyUtils.getPropertyDescriptors(orig);
    for (PropertyDescriptor origDescriptor : origDescriptors) {
        String name = origDescriptor.getName();
        if ("class".equals(name)) {
            continue; // No point in trying to set an object's class
        }
        if (PropertyUtils.isReadable(orig, name) &&
                PropertyUtils.isWriteable(dest, name)) {


            try {
                Class origPropClass = PropertyUtils.getPropertyType(orig, name);
                Class destPropClass = PropertyUtils.getPropertyType(dest, name);

                if (destPropClass.isAssignableFrom(origPropClass)) {
                    Object value =
                            PropertyUtils.getSimpleProperty(orig, name);
                    BeanUtils.copyProperty(dest, name, value);
                }
            } catch (NoSuchMethodException e) {
                // Should not happen
            }
        }
    }
}
 
開發者ID:nfl,項目名稱:audible,代碼行數:29,代碼來源:TypeSafeCopy.java

示例7: getFieldValue

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
/**
 * 獲取成員變量
 */
public static Object getFieldValue(Object obj, String fieldName) {
    Object propertyValue = null;
    try {
        if (PropertyUtils.isReadable(obj, fieldName)) {
            propertyValue = PropertyUtils.getProperty(obj, fieldName);
        }
    } catch (Exception e) {
        logger.error("獲取成員變量出錯!", e);
        throw new RuntimeException(e);
    }
    return propertyValue;
}
 
開發者ID:xuerong,項目名稱:MMServerEngine,代碼行數:16,代碼來源:ObjectUtil.java

示例8: propertyExists

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
static boolean propertyExists(Object bean, String property) {
    return PropertyUtils.isReadable(bean, property) && 
           PropertyUtils.isWriteable(bean, property); 
}
 
開發者ID:tairmansd,項目名稱:CriteriaBuilder,代碼行數:5,代碼來源:CriteriaServiceImpl.java

示例9: containsKey

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
public default boolean containsKey(String key) {
    return getAttributes().containsKey(key) || PropertyUtils.isReadable(this, key);
}
 
開發者ID:StallionCMS,項目名稱:stallion-core,代碼行數:4,代碼來源:MappedModel.java

示例10: propertyExists

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
public static boolean propertyExists(Object bean, String property) {
	return PropertyUtils.isReadable(bean, property) && PropertyUtils.isWriteable(bean, property);
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:4,代碼來源:Utils.java

示例11: propertyExists

import org.apache.commons.beanutils.PropertyUtils; //導入方法依賴的package包/類
/**
 * Check if writable property exists.
 *
 * @param bean bean to inspect
 * @param property name of property
 * @return true if writable property exists.
 */
private static boolean propertyExists(Object bean, String property) {
    return PropertyUtils.isReadable(bean, property)
            && PropertyUtils.isWriteable(bean, property);
}
 
開發者ID:Sybit-Education,項目名稱:airtable.java,代碼行數:12,代碼來源:Table.java


注:本文中的org.apache.commons.beanutils.PropertyUtils.isReadable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。