com.esotericsoftware.kryo.Kryo.getGenericsResolver()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中com.esotericsoftware.kryo.Kryo.getGenericsResolver()方法的一些代码示例,展示了Kryo.getGenericsResolver()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Kryo.getGenericsResolver()方法的具体详情如下:
包路径:com.esotericsoftware.kryo.Kryo
类名称:Kryo
方法名:getGenericsResolver

Kryo.getGenericsResolver介绍

暂无

代码示例

代码示例来源:origin: com.esotericsoftware/kryo

private Class<?> getTypeVarConcreteClass (Class[] generics, int typeVarNum, String typeVarName) {
  if (generics != null && generics.length > typeVarNum) {
    // If passed concrete classes are known explicitly, use this information
    return generics[typeVarNum];
  } else {
    // Otherwise try to derive the information from the current GenericScope
    if (TRACE) trace("kryo", "Trying to use kryo.getGenericScope");
    GenericsResolver scope = kryo.getGenericsResolver();
    if (scope.isSet()) {
      return scope.getConcreteClass(typeVarName);
    }
  }
  return null;
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

private Class<?> getTypeVarConcreteClass (Class[] generics, int typeVarNum, String typeVarName) {
  if (generics != null && generics.length > typeVarNum) {
    // If passed concrete classes are known explicitly, use this information
    return generics[typeVarNum];
  } else {
    // Otherwise try to derive the information from the current GenericScope
    if (TRACE) trace("kryo", "Trying to use kryo.getGenericScope");
    GenericsResolver scope = kryo.getGenericsResolver();
    if (scope.isSet()) {
      return scope.getConcreteClass(typeVarName);
    }
  }
  return null;
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

generics[i] = (Class)((ParameterizedType)actualType).getRawType();
else if (actualType instanceof TypeVariable) {
  GenericsResolver scope = kryo.getGenericsResolver();
  if (scope.isSet()) {
    Class clazz = scope.getConcreteClass(((TypeVariable)actualType).getName());
    generics[i] = Array.newInstance((Class)componentType, 0).getClass();
  else if (componentType instanceof TypeVariable) {
    GenericsResolver scope = kryo.getGenericsResolver();
    if (scope.isSet()) {
      Class clazz = scope.getConcreteClass(((TypeVariable)componentType).getName());

代码示例来源:origin: com.esotericsoftware/kryo

generics[i] = (Class)((ParameterizedType)actualType).getRawType();
else if (actualType instanceof TypeVariable) {
  GenericsResolver scope = kryo.getGenericsResolver();
  if (scope.isSet()) {
    Class clazz = scope.getConcreteClass(((TypeVariable)actualType).getName());
    generics[i] = Array.newInstance((Class)componentType, 0).getClass();
  else if (componentType instanceof TypeVariable) {
    GenericsResolver scope = kryo.getGenericsResolver();
    if (scope.isSet()) {
      Class clazz = scope.getConcreteClass(((TypeVariable)componentType).getName());

代码示例来源:origin: com.esotericsoftware/kryo

if (genericsScope != null) kryo.getGenericsResolver().pushScope(type, genericsScope);
if (genericsScope != null) kryo.getGenericsResolver().popScope();

代码示例来源:origin: com.esotericsoftware/kryo-shaded

if (genericsScope != null) kryo.getGenericsResolver().pushScope(type, genericsScope);
if (genericsScope != null) kryo.getGenericsResolver().popScope();

代码示例来源:origin: com.esotericsoftware/kryo

kryo.getGenericsResolver().pushScope(type, genericsScope);
kryo.getGenericsResolver().popScope();

代码示例来源:origin: com.esotericsoftware/kryo-shaded

kryo.getGenericsResolver().pushScope(type, genericsScope);
kryo.getGenericsResolver().popScope();

代码示例来源:origin: com.esotericsoftware/kryo-shaded

kryo.getGenericsResolver().pushScope(type, genericsScope);
if (config.isOptimizedGenerics() && genericsScope != null && kryo.getGenericsResolver() != null) {
  kryo.getGenericsResolver().popScope();

代码示例来源:origin: com.esotericsoftware/kryo

kryo.getGenericsResolver().pushScope(type, genericsScope);
if (config.isOptimizedGenerics() && genericsScope != null && kryo.getGenericsResolver() != null) {
  kryo.getGenericsResolver().popScope();

相关文章