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


Java TypeBindings.childInstance方法代码示例

本文整理汇总了Java中com.fasterxml.jackson.databind.type.TypeBindings.childInstance方法的典型用法代码示例。如果您正苦于以下问题:Java TypeBindings.childInstance方法的具体用法?Java TypeBindings.childInstance怎么用?Java TypeBindings.childInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.fasterxml.jackson.databind.type.TypeBindings的用法示例。


在下文中一共展示了TypeBindings.childInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getType

import com.fasterxml.jackson.databind.type.TypeBindings; //导入方法依赖的package包/类
protected JavaType getType(TypeBindings paramTypeBindings, TypeVariable<?>[] paramArrayOfTypeVariable)
{
  if ((paramArrayOfTypeVariable != null) && (paramArrayOfTypeVariable.length > 0))
  {
    paramTypeBindings = paramTypeBindings.childInstance();
    int i = paramArrayOfTypeVariable.length;
    for (int j = 0; j < i; j++)
    {
      TypeVariable<?> localTypeVariable = paramArrayOfTypeVariable[j];
      paramTypeBindings._addPlaceholder(localTypeVariable.getName());
      Type localType = localTypeVariable.getBounds()[0];
      JavaType localJavaType;
      if (localType == null)
        localJavaType = TypeFactory.unknownType();
      else
        localJavaType = paramTypeBindings.resolveType(localType);
      paramTypeBindings.addBinding(localTypeVariable.getName(), localJavaType);
    }
  }
  return paramTypeBindings.resolveType(getGenericType());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:22,代码来源:AnnotatedWithParams.java

示例2: getType

import com.fasterxml.jackson.databind.type.TypeBindings; //导入方法依赖的package包/类
protected JavaType getType(TypeBindings bindings, TypeVariable<?>[] typeParams)
{
    // [JACKSON-468] Need to consider local type binding declarations too...
    if (typeParams != null && typeParams.length > 0) {
        bindings = bindings.childInstance();
        for (TypeVariable<?> var : typeParams) {
            String name = var.getName();
            // to prevent infinite loops, need to first add placeholder ("<T extends Enum<T>>" etc)
            bindings._addPlaceholder(name);
            // About only useful piece of information is the lower bound (which is at least Object.class)
            Type lowerBound = var.getBounds()[0];
            JavaType type = (lowerBound == null) ? TypeFactory.unknownType()
                    : bindings.resolveType(lowerBound);
            bindings.addBinding(var.getName(), type);
        }
    }
    return bindings.resolveType(getGenericType());
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:19,代码来源:AnnotatedWithParams.java


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