当前位置: 首页>>代码示例>>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;未经允许,请勿转载。