本文整理汇总了Java中org.apache.ibatis.reflection.property.PropertyTokenizer.getIndex方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyTokenizer.getIndex方法的具体用法?Java PropertyTokenizer.getIndex怎么用?Java PropertyTokenizer.getIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ibatis.reflection.property.PropertyTokenizer
的用法示例。
在下文中一共展示了PropertyTokenizer.getIndex方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: get
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public Object get(PropertyTokenizer prop) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, map);
return getCollectionValue(prop, collection);
} else {
return map.get(prop.getName());
}
}
示例3: set
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public void set(PropertyTokenizer prop, Object value) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, map);
setCollectionValue(prop, collection, value);
} else {
map.put(prop.getName(), value);
}
}
示例4: get
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public Object get(PropertyTokenizer prop) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, object);
return getCollectionValue(prop, collection);
} else {
return getBeanProperty(prop, object);
}
}
示例5: set
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public void set(PropertyTokenizer prop, Object value) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, object);
setCollectionValue(prop, collection, value);
} else {
setBeanProperty(prop, object, value);
}
}
示例6: get
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
public Object get(PropertyTokenizer prop) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, map);
return getCollectionValue(prop, collection);
} else {
return map.get(prop.getName());
}
}
示例7: set
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
public void set(PropertyTokenizer prop, Object value) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, map);
setCollectionValue(prop, collection, value);
} else {
// map.put(prop.getName(), value);
// 默认情况下,映射事例如下"shop_name" -> "shopName"
map.put(changDBColumnToPropertyName(prop.getName()),value);
}
}
示例8: get
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
public Object get(PropertyTokenizer prop) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, object);
return getCollectionValue(prop, collection);
} else {
return getBeanProperty(prop, object);
}
}
示例9: set
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
public void set(PropertyTokenizer prop, Object value) {
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, object);
setCollectionValue(prop, collection, value);
} else {
setBeanProperty(prop, object, value);
}
}
示例10: get
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public Object get(PropertyTokenizer prop) {
//如果有index,说明是集合,那就要分解集合,调用的是BaseWrapper.resolveCollection 和 getCollectionValue
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, map);
return getCollectionValue(prop, collection);
} else {
return map.get(prop.getName());
}
}
示例11: get
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public Object get(PropertyTokenizer prop) {
//如果有index(有中括号),说明是集合,那就要解析集合,调用的是BaseWrapper.resolveCollection 和 getCollectionValue
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, object);
return getCollectionValue(prop, collection);
} else {
//否则,getBeanProperty
return getBeanProperty(prop, object);
}
}
示例12: set
import org.apache.ibatis.reflection.property.PropertyTokenizer; //导入方法依赖的package包/类
@Override
public void set(PropertyTokenizer prop, Object value) {
//如果有index,说明是集合,那就要解析集合,调用的是BaseWrapper.resolveCollection 和 setCollectionValue
if (prop.getIndex() != null) {
Object collection = resolveCollection(prop, object);
setCollectionValue(prop, collection, value);
} else {
//否则,setBeanProperty
setBeanProperty(prop, object, value);
}
}