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


Java Reifier.getResult方法代码示例

本文整理汇总了Java中sun.reflect.generics.visitor.Reifier.getResult方法的典型用法代码示例。如果您正苦于以下问题:Java Reifier.getResult方法的具体用法?Java Reifier.getResult怎么用?Java Reifier.getResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.reflect.generics.visitor.Reifier的用法示例。


在下文中一共展示了Reifier.getResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getExceptionTypes

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type[] getExceptionTypes(){
    if (exceptionTypes == null) { // lazily initialize exception types
        // first, extract exception type subtree(s) from AST
        FieldTypeSignature[] ets = getTree().getExceptionTypes();
        // create array to store reified subtree(s)
        Type[] es = new Type[ets.length];
        // reify all subtrees
        for (int i = 0; i < ets.length; i++) {
            Reifier r = getReifier(); // obtain visitor
            ets[i].accept(r); // reify subtree
            // extract result from visitor and store it
            es[i] = r.getResult();
        }
        exceptionTypes = es; // cache overall result
    }
    return exceptionTypes.clone(); // return cached result
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:18,代码来源:ConstructorRepository.java

示例2: getSuperInterfaces

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type[] getSuperInterfaces(){
    if (superInterfaces == null) { // lazily initialize super interfaces
        // first, extract super interface subtree(s) from AST
        TypeTree[] ts  = getTree().getSuperInterfaces();
        // create array to store reified subtree(s)
        Type[] sis = new Type[ts.length];
        // reify all subtrees
        for (int i = 0; i < ts.length; i++) {
            Reifier r = getReifier(); // obtain visitor
            ts[i].accept(r);// reify subtree
            // extract result from visitor and store it
            sis[i] = r.getResult();
        }
        superInterfaces = sis; // cache overall result
    }
    return superInterfaces.clone(); // return cached result
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:18,代码来源:ClassRepository.java

示例3: getParameterTypes

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的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
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:ConstructorRepository.java

示例4: getTypeParameters

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的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
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:GenericDeclRepository.java

示例5: getSuperInterfaces

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type[] getSuperInterfaces(){
    Type[] superInterfaces = this.superInterfaces;
    if (superInterfaces == null) { // lazily initialize super interfaces
        // first, extract super interface subtree(s) from AST
        TypeTree[] ts  = getTree().getSuperInterfaces();
        // create array to store reified subtree(s)
        Type[] sis = new Type[ts.length];
        // reify all subtrees
        for (int i = 0; i < ts.length; i++) {
            Reifier r = getReifier(); // obtain visitor
            ts[i].accept(r);// reify subtree
            // extract result from visitor and store it
            sis[i] = r.getResult();
        }
        superInterfaces = sis; // cache overall result
        this.superInterfaces = superInterfaces;
    }
    return superInterfaces.clone(); // return cached result
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ClassRepository.java

示例6: getSuperInterfaces

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type[] getSuperInterfaces() {
    Type[] superInterfaces = this.superInterfaces;
    if (superInterfaces == null) { // lazily initialize super interfaces
        // first, extract super interface subtree(s) from AST
        TypeTree[] ts  = getTree().getSuperInterfaces();
        // create array to store reified subtree(s)
        superInterfaces = new Type[ts.length];
        // reify all subtrees
        for (int i = 0; i < ts.length; i++) {
            Reifier r = getReifier(); // obtain visitor
            ts[i].accept(r);// reify subtree
            // extract result from visitor and store it
            superInterfaces[i] = r.getResult();
        }
        this.superInterfaces = superInterfaces;
    }
    return superInterfaces.clone(); // return cached result
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:19,代码来源:ClassRepository.java

示例7: getTypeParameters

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的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
}
 
开发者ID:infobip,项目名称:infobip-open-jdk-8,代码行数:24,代码来源:GenericDeclRepository.java

示例8: getTypeParameters

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的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
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:22,代码来源:GenericDeclRepository.java

示例9: parseSig

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的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);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:11,代码来源:AnnotationParser.java

示例10: getReturnType

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type getReturnType() {
    if (returnType == null) { // lazily initialize return type
        Reifier r = getReifier(); // obtain visitor
        // Extract return type subtree from AST and reify
        getTree().getReturnType().accept(r);
        // extract result from visitor and cache it
        returnType = r.getResult();
        }
    return returnType; // return cached result
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:11,代码来源:MethodRepository.java

示例11: computeExceptionTypes

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
private Type[] computeExceptionTypes() {
    // first, extract exception type subtree(s) from AST
    FieldTypeSignature[] ets = getTree().getExceptionTypes();
    // create array to store reified subtree(s)
    int length = ets.length;
    Type[] exceptionTypes = new Type[length];
    // reify all subtrees
    for (int i = 0; i < length; i++) {
        Reifier r = getReifier(); // obtain visitor
        ets[i].accept(r); // reify subtree
        // extract result from visitor and store it
        exceptionTypes[i] = r.getResult();
    }
    return exceptionTypes;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:ConstructorRepository.java

示例12: getGenericType

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type getGenericType(){
    if (genericType == null) { // lazily initialize generic type
        Reifier r = getReifier(); // obtain visitor
        getTree().accept(r); // reify subtree
        // extract result from visitor and cache it
        genericType = r.getResult();
    }
    return genericType; // return cached result
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:10,代码来源:FieldRepository.java

示例13: parseSig

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:AnnotationParser.java

示例14: getSuperclass

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
public Type getSuperclass() {
    Type superclass = this.superclass;
    if (superclass == null) { // lazily initialize superclass
        Reifier r = getReifier(); // obtain visitor
        // Extract superclass subtree from AST and reify
        getTree().getSuperclass().accept(r);
        // extract result from visitor and cache it
        superclass = r.getResult();
        this.superclass = superclass;
    }
    return superclass; // return cached result
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:13,代码来源:ClassRepository.java

示例15: reifyBounds

import sun.reflect.generics.visitor.Reifier; //导入方法依赖的package包/类
Type[] reifyBounds(FieldTypeSignature[] boundASTs) {
    final int length = boundASTs.length;
    final Type[] bounds = new Type[length];
    // iterate over bound trees, reifying each in turn
    for (int i = 0; i < length; i++) {
        Reifier r = getReifier();
        boundASTs[i].accept(r);
        bounds[i] = r.getResult();
    }
    return bounds;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:12,代码来源:LazyReflectiveObjectGenerator.java


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