本文整理汇总了Java中sun.reflect.generics.tree.TypeSignature类的典型用法代码示例。如果您正苦于以下问题:Java TypeSignature类的具体用法?Java TypeSignature怎么用?Java TypeSignature使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TypeSignature类属于sun.reflect.generics.tree包,在下文中一共展示了TypeSignature类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParameterTypes
import sun.reflect.generics.tree.TypeSignature; //导入依赖的package包/类
public Type[] getParameterTypes(){
if (paramTypes == null) { // lazily initialize parameter types
// first, extract parameter type subtree(s) from AST
TypeSignature[] pts = getTree().getParameterTypes();
// create array to store reified subtree(s)
Type[] ps = new Type[pts.length];
// reify all subtrees
for (int i = 0; i < pts.length; i++) {
Reifier r = getReifier(); // obtain visitor
pts[i].accept(r); // reify subtree
// extract result from visitor and store it
ps[i] = r.getResult();
}
paramTypes = ps; // cache overall result
}
return paramTypes.clone(); // return cached result
}
示例2: parseSig
import sun.reflect.generics.tree.TypeSignature; //导入依赖的package包/类
private static Class<?> parseSig(String sig, Class container) {
if (sig.equals("V")) return void.class;
SignatureParser parser = SignatureParser.make();
TypeSignature typeSig = parser.parseTypeSig(sig);
GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
Reifier reify = Reifier.make(factory);
typeSig.accept(reify);
Type result = reify.getResult();
return toClass(result);
}
示例3: parseSig
import sun.reflect.generics.tree.TypeSignature; //导入依赖的package包/类
private static Class<?> parseSig(String sig, Class<?> container) {
if (sig.equals("V")) return void.class;
SignatureParser parser = SignatureParser.make();
TypeSignature typeSig = parser.parseTypeSig(sig);
GenericsFactory factory = CoreReflectionFactory.make(container, ClassScope.make(container));
Reifier reify = Reifier.make(factory);
typeSig.accept(reify);
Type result = reify.getResult();
return toClass(result);
}
示例4: computeParameterTypes
import sun.reflect.generics.tree.TypeSignature; //导入依赖的package包/类
private Type[] computeParameterTypes() {
// first, extract parameter type subtree(s) from AST
TypeSignature[] pts = getTree().getParameterTypes();
// create array to store reified subtree(s)
int length = pts.length;
Type[] parameterTypes = new Type[length];
// reify all subtrees
for (int i = 0; i < length; i++) {
Reifier r = getReifier(); // obtain visitor
pts[i].accept(r); // reify subtree
// extract result from visitor and store it
parameterTypes[i] = r.getResult();
}
return parameterTypes;
}
示例5: parse
import sun.reflect.generics.tree.TypeSignature; //导入依赖的package包/类
protected TypeSignature parse(String s) {
return SignatureParser.make().parseTypeSig(s);
}