本文整理汇总了Java中com.googlecode.gentyref.GenericTypeReflector.getTypeName方法的典型用法代码示例。如果您正苦于以下问题:Java GenericTypeReflector.getTypeName方法的具体用法?Java GenericTypeReflector.getTypeName怎么用?Java GenericTypeReflector.getTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.gentyref.GenericTypeReflector
的用法示例。
在下文中一共展示了GenericTypeReflector.getTypeName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import com.googlecode.gentyref.GenericTypeReflector; //导入方法依赖的package包/类
@Override
public String toString() {
if (lowerBounds.length > 0) {
return "? super " + GenericTypeReflector.getTypeName(lowerBounds[0]);
} else if (upperBounds[0] == Object.class) {
return "?";
} else {
return "? extends " + GenericTypeReflector.getTypeName(upperBounds[0]);
}
}
示例2: SJTranslaterTranslater
import com.googlecode.gentyref.GenericTypeReflector; //导入方法依赖的package包/类
public SJTranslaterTranslater(SJTranslater<T> translater, TypeAndAnnos info) {
super();
this.translater = translater;
typeName = GenericTypeReflector.getTypeName(info.type);
type = info.type;
el = info.annos;
}
示例3: EnumTranslater
import com.googlecode.gentyref.GenericTypeReflector; //导入方法依赖的package包/类
public EnumTranslater(Type fromType) {
typeName = GenericTypeReflector.getTypeName(fromType);
enumClass = (Class<T>) GenericTypeReflector.erase(fromType);
}
示例4: ObjectTranslater
import com.googlecode.gentyref.GenericTypeReflector; //导入方法依赖的package包/类
public ObjectTranslater(Type fromType) {
fromClass = (Class<T>) GenericTypeReflector.erase(fromType);
typeName = GenericTypeReflector.getTypeName(fromType);
Type t = fromType;
while (t != null) {
Class<?> cls = GenericTypeReflector.erase(t);
for (Field field : cls.getDeclaredFields()) {
if (!SJUtils.IsJSONPrintable(field))
continue ;
FieldCache fc = new FieldCache();
fc.name = SJUtils.getFieldName(field);
Until until = field.getAnnotation(Until.class);
if (until != null)
fc.until = until.value();
Since since = field.getAnnotation(Since.class);
if (since != null)
fc.since = since.value();
fc.type = GenericTypeReflector.getExactFieldType(field, fromType);
Class<?> fieldClass = GenericTypeReflector.erase(fc.type);
if (fieldClass.isPrimitive()) {
fieldClass = SJUtils.PRIMITIVES_TO_WRAPPERS.get(fieldClass);
fc.type = fieldClass;
}
fc.strictType = field.isAnnotationPresent(StrictType.class) || Map.class.isAssignableFrom(fieldClass) || Collection.class.isAssignableFrom(fieldClass);
fc.checkForNull = field.isAnnotationPresent(SCheckForNull.class);
fc.field = field;
fields.add(fc);
}
t = SJUtils.getParent(cls);
}
}
示例5: getTypeName
import com.googlecode.gentyref.GenericTypeReflector; //导入方法依赖的package包/类
/**
* <p>
* getTypeName
* </p>
*
* @return a {@link java.lang.String} object.
*/
public String getTypeName() {
return GenericTypeReflector.getTypeName(type);
}