本文整理汇总了Java中sun.reflect.generics.tree.FormalTypeParameter类的典型用法代码示例。如果您正苦于以下问题:Java FormalTypeParameter类的具体用法?Java FormalTypeParameter怎么用?Java FormalTypeParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FormalTypeParameter类属于sun.reflect.generics.tree包,在下文中一共展示了FormalTypeParameter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeParameters
import sun.reflect.generics.tree.FormalTypeParameter; //导入依赖的package包/类
/**
* Return the formal type parameters of this generic declaration.
* @return the formal type parameters of this generic declaration
*/
public TypeVariable<?>[] getTypeParameters(){
if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
// reify all subtrees
for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree
// extract result from visitor and store it
tps[i] = (TypeVariable<?>) r.getResult();
}
typeParams = tps; // cache overall result
}
return typeParams.clone(); // return cached result
}
示例2: getTypeParameters
import sun.reflect.generics.tree.FormalTypeParameter; //导入依赖的package包/类
/**
* Return the formal type parameters of this generic declaration.
* @return the formal type parameters of this generic declaration
*/
public TypeVariable/*<?>*/[] getTypeParameters(){
if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
TypeVariable[] tps = new TypeVariable[ftps.length];
// reify all subtrees
for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree
// extract result from visitor and store it
tps[i] = (TypeVariable<?>) r.getResult();
}
typeParams = tps; // cache overall result
}
return typeParams.clone(); // return cached result
}
示例3: getTypeParameters
import sun.reflect.generics.tree.FormalTypeParameter; //导入依赖的package包/类
/**
* Return the formal type parameters of this generic declaration.
* @return the formal type parameters of this generic declaration
*/
public TypeVariable<?>[] getTypeParameters(){
TypeVariable[] typeParams = this.typeParams;
if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
// reify all subtrees
for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree
// extract result from visitor and store it
tps[i] = (TypeVariable<?>) r.getResult();
}
typeParams = tps; // cache overall result
this.typeParams = typeParams;
}
return typeParams.clone(); // return cached result
}
示例4: getTypeParameters
import sun.reflect.generics.tree.FormalTypeParameter; //导入依赖的package包/类
/**
* Return the formal type parameters of this generic declaration.
* @return the formal type parameters of this generic declaration
*/
public TypeVariable<?>[] getTypeParameters() {
TypeVariable<?>[] typeParams = this.typeParams;
if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
typeParams = new TypeVariable<?>[ftps.length];
// reify all subtrees
for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree
// extract result from visitor and store it
typeParams[i] = (TypeVariable<?>) r.getResult();
}
this.typeParams = typeParams; // cache overall result
}
return typeParams.clone(); // return cached result
}
示例5: computeTypeParameters
import sun.reflect.generics.tree.FormalTypeParameter; //导入依赖的package包/类
private TypeVariable<?>[] computeTypeParameters() {
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
int length = ftps.length;
TypeVariable<?>[] typeParameters = new TypeVariable<?>[length];
// reify all subtrees
for (int i = 0; i < length; i++) {
Reifier r = getReifier(); // obtain visitor
ftps[i].accept(r); // reify subtree
// extract result from visitor and store it
typeParameters[i] = (TypeVariable<?>) r.getResult();
}
return typeParameters;
}