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


Java GenericTypeReflector.getTypeName方法代码示例

本文整理汇总了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]);
	}
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:11,代码来源:WildcardTypeImpl.java

示例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;
}
 
开发者ID:salomonbrys-deprecated,项目名称:SourJSON,代码行数:8,代码来源:SJTranslaterTranslater.java

示例3: EnumTranslater

import com.googlecode.gentyref.GenericTypeReflector; //导入方法依赖的package包/类
public EnumTranslater(Type fromType) {
	typeName = GenericTypeReflector.getTypeName(fromType);
	enumClass = (Class<T>) GenericTypeReflector.erase(fromType);
}
 
开发者ID:salomonbrys-deprecated,项目名称:SourJSON,代码行数:5,代码来源:EnumTranslater.java

示例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);
	}
}
 
开发者ID:salomonbrys-deprecated,项目名称:SourJSON,代码行数:45,代码来源:ObjectTranslater.java

示例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);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:11,代码来源:GenericClass.java


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