当前位置: 首页>>代码示例>>Java>>正文


Java PropertyTokenizer类代码示例

本文整理汇总了Java中org.apache.ibatis.reflection.property.PropertyTokenizer的典型用法代码示例。如果您正苦于以下问题:Java PropertyTokenizer类的具体用法?Java PropertyTokenizer怎么用?Java PropertyTokenizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyTokenizer类属于org.apache.ibatis.reflection.property包,在下文中一共展示了PropertyTokenizer类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getGetterType

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
private Class<?> getGetterType(PropertyTokenizer prop) {
  Class<?> type = reflector.getGetterType(prop.getName());
  if (prop.getIndex() != null && Collection.class.isAssignableFrom(type)) {
    Type returnType = getGenericGetterType(prop.getName());
    if (returnType instanceof ParameterizedType) {
      Type[] actualTypeArguments = ((ParameterizedType) returnType).getActualTypeArguments();
      if (actualTypeArguments != null && actualTypeArguments.length == 1) {
        returnType = actualTypeArguments[0];
        if (returnType instanceof Class) {
          type = (Class<?>) returnType;
        } else if (returnType instanceof ParameterizedType) {
          type = (Class<?>) ((ParameterizedType) returnType).getRawType();
        }
      }
    }
  }
  return type;
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:19,代码来源:MetaClass.java

示例2: getSetterType

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
@Override
public Class<?> getSetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return Object.class;
    } else {
      return metaValue.getSetterType(prop.getChildren());
    }
  } else {
    if (map.get(name) != null) {
      return map.get(name).getClass();
    } else {
      return Object.class;
    }
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:19,代码来源:MapWrapper.java

示例3: getGetterType

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
@Override
public Class<?> getGetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return Object.class;
    } else {
      return metaValue.getGetterType(prop.getChildren());
    }
  } else {
    if (map.get(name) != null) {
      return map.get(name).getClass();
    } else {
      return Object.class;
    }
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:19,代码来源:MapWrapper.java

示例4: hasGetter

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的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

示例5: hasSetter

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
@Override
public boolean hasSetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (metaClass.hasSetter(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return metaClass.hasSetter(name);
      } else {
        return metaValue.hasSetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return metaClass.hasSetter(name);
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:19,代码来源:BeanWrapper.java

示例6: hasGetter

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的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

示例7: setValue

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
public void setValue(String name, Object value) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      if (value == null && prop.getChildren() != null) {
        // don't instantiate child path if value is null
        return;
      } else {
        metaValue = objectWrapper.instantiatePropertyValue(name, prop, objectFactory);
      }
    }
    metaValue.setValue(prop.getChildren(), value);
  } else {
    objectWrapper.set(prop, value);
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:18,代码来源:MetaObject.java

示例8: getSetterType

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
public Class<?> getSetterType(String name) {
	PropertyTokenizer prop = new PropertyTokenizer(name);
	if (prop.hasNext()) {
		MetaObject metaValue = metaObject.metaObjectForProperty(prop
				.getIndexedName());
		if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
			return Object.class;
		} else {
			return metaValue.getSetterType(prop.getChildren());
		}
	} else {
		if (map.get(name) != null) {
			return map.get(name).getClass();
		} else {
			return Object.class;
		}
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:19,代码来源:MapWrapper.java

示例9: getGetterType

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
public Class<?> getGetterType(String name) {
	PropertyTokenizer prop = new PropertyTokenizer(name);
	if (prop.hasNext()) {
		MetaObject metaValue = metaObject.metaObjectForProperty(prop
				.getIndexedName());
		if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
			return Object.class;
		} else {
			return metaValue.getGetterType(prop.getChildren());
		}
	} else {
		if (map.get(name) != null) {
			return map.get(name).getClass();
		} else {
			return Object.class;
		}
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:19,代码来源:MapWrapper.java

示例10: hasGetter

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的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

示例11: hasSetter

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
public boolean hasSetter(String name) {
	PropertyTokenizer prop = new PropertyTokenizer(name);
	if (prop.hasNext()) {
		if (metaClass.hasSetter(prop.getIndexedName())) {
			MetaObject metaValue = metaObject.metaObjectForProperty(prop
					.getIndexedName());
			if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
				return metaClass.hasSetter(name);
			} else {
				return metaValue.hasSetter(prop.getChildren());
			}
		} else {
			return false;
		}
	} else {
		return metaClass.hasSetter(name);
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:19,代码来源:BeanWrapper.java

示例12: hasGetter

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的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

示例13: instantiatePropertyValue

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
public MetaObject instantiatePropertyValue(String name,
		PropertyTokenizer prop, ObjectFactory objectFactory) {
	MetaObject metaValue;
	Class<?> type = getSetterType(prop.getName());
	try {
		Object newObject = objectFactory.create(type);
		metaValue = MetaObject.forObject(newObject,
				metaObject.getObjectFactory(),
				metaObject.getObjectWrapperFactory());
		set(prop, newObject);
	} catch (Exception e) {
		throw new ReflectionException("Cannot set value of property '"
				+ name + "' because '" + name
				+ "' is null and cannot be instantiated on instance of "
				+ type.getName() + ". Cause:" + e.toString(), e);
	}
	return metaValue;
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:19,代码来源:BeanWrapper.java

示例14: setValue

import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入依赖的package包/类
public void setValue(String name, Object value) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      if (value == null && prop.getChildren() != null) {
        // don't instantiate child path if value is null
        //如果上层就是null了,还得看有没有儿子,没有那就结束
        return;
      } else {
          //否则还得new一个,委派给ObjectWrapper.instantiatePropertyValue
        metaValue = objectWrapper.instantiatePropertyValue(name, prop, objectFactory);
      }
    }
    //递归调用setValue
    metaValue.setValue(prop.getChildren(), value);
  } else {
      //到了最后一层了,所以委派给ObjectWrapper.set
    objectWrapper.set(prop, value);
  }
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:22,代码来源:MetaObject.java


注:本文中的org.apache.ibatis.reflection.property.PropertyTokenizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。