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


Java Level2Mapper类代码示例

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


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

示例1: testReturn_Lv2CustomClass

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv2CustomClass() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectCalculator", Calculator.class);
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertTrue(result instanceof ParameterizedType);
  ParameterizedType paramType = (ParameterizedType) result;
  assertEquals(Calculator.class, paramType.getRawType());
  assertEquals(1, paramType.getActualTypeArguments().length);
  assertEquals(String.class, paramType.getActualTypeArguments()[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:12,代码来源:TypeParameterResolverTest.java

示例2: testReturn_Lv2CustomClassList

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv2CustomClassList() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectCalculatorList");
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertTrue(result instanceof ParameterizedType);
  ParameterizedType paramTypeOuter = (ParameterizedType) result;
  assertEquals(List.class, paramTypeOuter.getRawType());
  assertEquals(1, paramTypeOuter.getActualTypeArguments().length);
  ParameterizedType paramTypeInner = (ParameterizedType) paramTypeOuter.getActualTypeArguments()[0];
  assertEquals(Calculator.class, paramTypeInner.getRawType());
  assertEquals(Date.class, paramTypeInner.getActualTypeArguments()[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:14,代码来源:TypeParameterResolverTest.java

示例3: testReturn_Lv2Class

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv2Class() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("select", Object.class);
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertEquals(String.class, result);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:8,代码来源:TypeParameterResolverTest.java

示例4: testReturn_Lv2ArrayOfArray

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv2ArrayOfArray() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectArrayOfArray");
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertTrue(result instanceof Class);
  Class<?> resultClass = (Class<?>) result;
  assertTrue(result instanceof Class);
  assertTrue(resultClass.isArray());
  assertTrue(resultClass.getComponentType().isArray());
  assertEquals(String.class, resultClass.getComponentType().getComponentType());
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:13,代码来源:TypeParameterResolverTest.java

示例5: testReturn_Lv2ArrayOfList

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv2ArrayOfList() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectArrayOfList");
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertTrue(result instanceof GenericArrayType);
  GenericArrayType genericArrayType = (GenericArrayType) result;
  assertTrue(genericArrayType.getGenericComponentType() instanceof ParameterizedType);
  ParameterizedType paramType = (ParameterizedType) genericArrayType.getGenericComponentType();
  assertEquals(List.class, paramType.getRawType());
  assertEquals(String.class, paramType.getActualTypeArguments()[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:13,代码来源:TypeParameterResolverTest.java

示例6: testReturn_Lv2WildcardList

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv2WildcardList() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectWildcardList");
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertTrue(result instanceof ParameterizedType);
  ParameterizedType type = (ParameterizedType) result;
  assertEquals(List.class, type.getRawType());
  assertEquals(1, type.getActualTypeArguments().length);
  assertTrue(type.getActualTypeArguments()[0] instanceof WildcardType);
  WildcardType wildcard = (WildcardType) type.getActualTypeArguments()[0];
  assertEquals(0, wildcard.getLowerBounds().length);
  assertEquals(1, wildcard.getUpperBounds().length);
  assertEquals(String.class, wildcard.getUpperBounds()[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:16,代码来源:TypeParameterResolverTest.java

示例7: testReturn_LV2Map

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testReturn_LV2Map() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectMap");
  Type result = TypeParameterResolver.resolveReturnType(method, clazz);
  assertTrue(result instanceof ParameterizedType);
  ParameterizedType paramType = (ParameterizedType) result;
  assertEquals(Map.class, paramType.getRawType());
  assertEquals(2, paramType.getActualTypeArguments().length);
  assertEquals(String.class, paramType.getActualTypeArguments()[0]);
  assertEquals(Integer.class, paramType.getActualTypeArguments()[1]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:13,代码来源:TypeParameterResolverTest.java

示例8: testParam_Primitive

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testParam_Primitive() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("simpleSelectPrimitive", int.class);
  Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
  assertEquals(1, result.length);
  assertEquals(int.class, result[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:9,代码来源:TypeParameterResolverTest.java

示例9: testParam_Lv2Single

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testParam_Lv2Single() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("select", Object.class);
  Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
  assertEquals(1, result.length);
  assertEquals(String.class, result[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:9,代码来源:TypeParameterResolverTest.java

示例10: testParam_Lv2Multiple

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testParam_Lv2Multiple() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectList", Object.class, Object.class);
  Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
  assertEquals(2, result.length);
  assertEquals(Integer.class, result[0]);
  assertEquals(String.class, result[1]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:10,代码来源:TypeParameterResolverTest.java

示例11: testParam_Lv2CustomClass

import org.apache.ibatis.reflection.typeparam.Level2Mapper; //导入依赖的package包/类
@Test
public void testParam_Lv2CustomClass() throws Exception {
  Class<?> clazz = Level2Mapper.class;
  Method method = clazz.getMethod("selectCalculator", Calculator.class);
  Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
  assertEquals(1, result.length);
  assertTrue(result[0] instanceof ParameterizedType);
  ParameterizedType paramType = (ParameterizedType) result[0];
  assertEquals(Calculator.class, paramType.getRawType());
  assertEquals(1, paramType.getActualTypeArguments().length);
  assertEquals(String.class, paramType.getActualTypeArguments()[0]);
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:13,代码来源:TypeParameterResolverTest.java


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