本文整理匯總了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());
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
示例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;
}
示例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() + ".");
}
}
示例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;
}
示例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;
}
示例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;
}