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


Java MetaObject.hasGetter方法代碼示例

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


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

示例1: hasGetter

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
@Override
public boolean hasGetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (map.containsKey(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return true;
      } else {
        return metaValue.hasGetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return map.containsKey(prop.getName());
  }
}
 
開發者ID:yuexiahandao,項目名稱:MybatisCode,代碼行數:19,代碼來源:MapWrapper.java

示例2: hasGetter

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
@Override
public boolean hasGetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (metaClass.hasGetter(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return metaClass.hasGetter(name);
      } else {
        return metaValue.hasGetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return metaClass.hasGetter(name);
  }
}
 
開發者ID:yuexiahandao,項目名稱:MybatisCode,代碼行數:19,代碼來源:BeanWrapper.java

示例3: hasGetter

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
public boolean hasGetter(String name) {
	PropertyTokenizer prop = new PropertyTokenizer(name);
	if (prop.hasNext()) {
		if (map.containsKey(prop.getIndexedName())) {
			MetaObject metaValue = metaObject.metaObjectForProperty(prop
					.getIndexedName());
			if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
				return true;
			} else {
				return metaValue.hasGetter(prop.getChildren());
			}
		} else {
			return false;
		}
	} else {
		return map.containsKey(prop.getName());
	}
}
 
開發者ID:yinshipeng,項目名稱:sosoapi-base,代碼行數:19,代碼來源:MapWrapper.java

示例4: hasGetter

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
public boolean hasGetter(String name) {
	PropertyTokenizer prop = new PropertyTokenizer(name);
	if (prop.hasNext()) {
		if (metaClass.hasGetter(prop.getIndexedName())) {
			MetaObject metaValue = metaObject.metaObjectForProperty(prop
					.getIndexedName());
			if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
				return metaClass.hasGetter(name);
			} else {
				return metaValue.hasGetter(prop.getChildren());
			}
		} else {
			return false;
		}
	} else {
		return metaClass.hasGetter(name);
	}
}
 
開發者ID:yinshipeng,項目名稱:sosoapi-base,代碼行數:19,代碼來源:BeanWrapper.java

示例5: findTargetObject

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
public static MetaObject findTargetObject(Invocation invocation) {
    MetaObject metaObject = MetaObject.forObject(invocation.getTarget(), OBJECT_FACTORY, OBJECT_WRAPPER_FACTORY);
    while (metaObject.hasGetter(HANDLER_FIELD)) {
        Object o = metaObject.getValue(HANDLER_FIELD);
        metaObject = MetaObject.forObject(o, OBJECT_FACTORY, OBJECT_WRAPPER_FACTORY);
        if (metaObject.hasGetter(TARGET_FIELD)) {
            o = metaObject.getValue(TARGET_FIELD);
            metaObject = MetaObject.forObject(o, OBJECT_FACTORY, OBJECT_WRAPPER_FACTORY);
        }
    }
    return metaObject;
}
 
開發者ID:YanXs,項目名稱:nighthawk,代碼行數:13,代碼來源:MetaObjectUtils.java

示例6: setValue

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
private void setValue(MetaObject metaParam, String property, Object value) {
    if (metaParam.hasSetter(property)) {
        if(metaParam.hasGetter(property)){
            Object defaultValue = metaParam.getValue(property);
            if(defaultValue != null){
                return;
            }
        }
        metaParam.setValue(property, value);
    } else {
        throw new ExecutorException("No setter found for the keyProperty '" + property + "' in " + metaParam.getOriginalObject().getClass().getName() + ".");
    }
}
 
開發者ID:godlike110,項目名稱:tk-mybatis,代碼行數:14,代碼來源:SelectKeyGenerator.java

示例7: getParamValue

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
/**
 * 從對象中取參數
 *
 * @param paramsObject
 * @param paramName
 * @param required
 * @return
 */
public static Object getParamValue(MetaObject paramsObject, String paramName, boolean required) {
    Object value = null;
    if (paramsObject.hasGetter(PARAMS.get(paramName))) {
        value = paramsObject.getValue(PARAMS.get(paramName));
    }
    if (required && value == null) {
        throw new RuntimeException("分頁查詢缺少必要的參數:" + PARAMS.get(paramName));
    }
    return value;
}
 
開發者ID:geeker-lait,項目名稱:tasfe-framework,代碼行數:19,代碼來源:SqlUtil.java

示例8: setFieldValByName

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
/**
 * <p>
 * Common method to set value for java bean.
 * </p>
 * <p>
 * 如果包含前綴 et 使用該方法,否則可以直接 metaObject.setValue(fieldName, fieldVal);
 * </p>
 *
 * @param fieldName  java bean property name
 * @param fieldVal   java bean property value
 * @param metaObject meta object parameter
 */
public MetaObjectHandler setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject) {
    if (metaObject.hasSetter(fieldName) && metaObject.hasGetter(fieldName)) {
        metaObject.setValue(fieldName, fieldVal);
    } else if (metaObject.hasGetter(META_OBJ_PREFIX)) {
        Object et = metaObject.getValue(META_OBJ_PREFIX);
        if (et != null) {
            MetaObject etMeta = SystemMetaObject.forObject(et);
            if (etMeta.hasSetter(fieldName)) {
                etMeta.setValue(fieldName, fieldVal);
            }
        }
    }
    return this;
}
 
開發者ID:baomidou,項目名稱:mybatis-plus,代碼行數:27,代碼來源:MetaObjectHandler.java

示例9: getFieldValByName

import org.apache.ibatis.reflection.MetaObject; //導入方法依賴的package包/類
/**
 * <p>
 * get value from java bean by propertyName
 * </p>
 * <p>
 * 如果包含前綴 et 使用該方法,否則可以直接 metaObject.setValue(fieldName, fieldVal);
 * </p>
 *
 * @param fieldName  java bean property name
 * @param metaObject parameter wrapper
 * @return
 */
public Object getFieldValByName(String fieldName, MetaObject metaObject) {
    if (metaObject.hasGetter(fieldName)) {
        return metaObject.getValue(fieldName);
    } else if (metaObject.hasGetter(META_OBJ_PREFIX + "." + fieldName)) {
        return metaObject.getValue(META_OBJ_PREFIX + "." + fieldName);
    }
    return null;
}
 
開發者ID:baomidou,項目名稱:mybatis-plus,代碼行數:21,代碼來源:MetaObjectHandler.java


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