sun.reflect.generics.tree.FormalTypeParameter Java Examples

The following examples show how to use sun.reflect.generics.tree.FormalTypeParameter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GenericDeclRepository.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #2
Source File: GenericDeclRepository.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #3
Source File: GenericDeclRepository.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #4
Source File: GenericDeclRepository.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #5
Source File: GenericDeclRepository.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #6
Source File: GenericDeclRepository.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #7
Source File: GenericDeclRepository.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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
}
 
Example #8
Source File: GenericDeclRepository.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #9
Source File: GenericDeclRepository.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #10
Source File: GenericDeclRepository.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #11
Source File: GenericDeclRepository.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #12
Source File: GenericDeclRepository.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #13
Source File: GenericDeclRepository.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #14
Source File: GenericDeclRepository.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
}
 
Example #15
Source File: GenericDeclRepository.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #16
Source File: GenericDeclRepository.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}