com.google.gson.reflect.TypeToken.getSuperclassTypeParameter()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(175)

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

TypeToken.getSuperclassTypeParameter介绍

[英]Returns the type from super class's type parameter in $Gson$Types#canonicalize.
[中]从$Gson$Types#canonicalize中的super类的type参数返回类型。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: eatnumber1/google-gson

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.gson

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: com.google/gson

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: Odoo-mobile/framework

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: Nextdoor/bender

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

代码示例来源:origin: fesch/CanZE

/**
 * Constructs a new type literal. Derives represented class from type
 * parameter.
 *
 * <p>Clients create an empty anonymous subclass. Doing so embeds the type
 * parameter in the anonymous class's type hierarchy so we can reconstitute it
 * at runtime despite erasure.
 */
@SuppressWarnings("unchecked")
protected TypeToken() {
 this.type = getSuperclassTypeParameter(getClass());
 this.rawType = (Class<? super T>) $Gson$Types.getRawType(type);
 this.hashCode = type.hashCode();
}

相关文章