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


Java PropertyTokenizer.getIndex方法代码示例

本文整理汇总了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;
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:19,代码来源:MetaClass.java

示例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());
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:10,代码来源:MapWrapper.java

示例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);
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:10,代码来源:MapWrapper.java

示例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);
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:10,代码来源:BeanWrapper.java

示例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);
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:10,代码来源:BeanWrapper.java

示例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());
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:9,代码来源:MapWrapper.java

示例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);
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:12,代码来源:MapWrapper.java

示例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);
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:9,代码来源:BeanWrapper.java

示例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);
	}
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:9,代码来源:BeanWrapper.java

示例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());
  }
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:11,代码来源:MapWrapper.java

示例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);
  }
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:12,代码来源:BeanWrapper.java

示例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);
  }
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:12,代码来源:BeanWrapper.java


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