sun.reflect.generics.factory.GenericsFactory Java Examples

The following examples show how to use sun.reflect.generics.factory.GenericsFactory. 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 Project: dragonwell8_jdk   Author: alibaba   File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #2
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #3
Source Project: dragonwell8_jdk   Author: alibaba   File: TypeVariableImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private TypeVariableImpl(D decl, String n, FieldTypeSignature[] bs,
                         GenericsFactory f) {
    super(f);
    genericDeclaration = decl;
    name = n;
    boundASTs = bs;
}
 
Example #4
Source Project: dragonwell8_jdk   Author: alibaba   File: WildcardTypeImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private WildcardTypeImpl(FieldTypeSignature[] ubs,
                         FieldTypeSignature[] lbs,
                         GenericsFactory f) {
    super(f);
    upperBoundASTs = ubs;
    lowerBoundASTs = lbs;
}
 
Example #5
Source Project: TencentKona-8   Author: Tencent   File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #6
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: WildcardTypeImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private WildcardTypeImpl(FieldTypeSignature[] ubs,
                         FieldTypeSignature[] lbs,
                         GenericsFactory f) {
    super(f);
    upperBoundASTs = ubs;
    lowerBoundASTs = lbs;
}
 
Example #7
Source Project: TencentKona-8   Author: Tencent   File: TypeVariableImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Factory method.
 * @param decl - the reflective object that declared the type variable
 * that this method should create
 * @param name - the name of the type variable to be returned
 * @param bs - an array of ASTs representing the bounds for the type
 * variable to be created
 * @param f - a factory that can be used to manufacture reflective
 * objects that represent the bounds of this type variable
 * @return A type variable with name, bounds, declaration and factory
 * specified
 */
public static <T extends GenericDeclaration>
                         TypeVariableImpl<T> make(T decl, String name,
                                                  FieldTypeSignature[] bs,
                                                  GenericsFactory f) {

    if (!((decl instanceof Class) ||
            (decl instanceof Method) ||
            (decl instanceof Constructor))) {
        throw new AssertionError("Unexpected kind of GenericDeclaration" +
                decl.getClass().toString());
    }
    return new TypeVariableImpl<T>(decl, name, bs, f);
}
 
Example #8
Source Project: jdk8u60   Author: chenghanpeng   File: AnnotationParser.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #9
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: TypeVariableImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Factory method.
 * @param decl - the reflective object that declared the type variable
 * that this method should create
 * @param name - the name of the type variable to be returned
 * @param bs - an array of ASTs representing the bounds for the type
 * variable to be created
 * @param f - a factory that can be used to manufacture reflective
 * objects that represent the bounds of this type variable
 * @return A type variable with name, bounds, declaration and factory
 * specified
 */
public static <T extends GenericDeclaration>
                         TypeVariableImpl<T> make(T decl, String name,
                                                  FieldTypeSignature[] bs,
                                                  GenericsFactory f) {

    if (!((decl instanceof Class) ||
            (decl instanceof Method) ||
            (decl instanceof Constructor))) {
        throw new AssertionError("Unexpected kind of GenericDeclaration" +
                decl.getClass().toString());
    }
    return new TypeVariableImpl<T>(decl, name, bs, f);
}
 
Example #10
Source Project: jdk8u60   Author: chenghanpeng   File: TypeVariableImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private TypeVariableImpl(D decl, String n, FieldTypeSignature[] bs,
                         GenericsFactory f) {
    super(f);
    genericDeclaration = decl;
    name = n;
    boundASTs = bs;
}
 
Example #11
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: Class.java    License: Apache License 2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, ClassScope.make(this));
}
 
Example #12
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: Method.java    License: Apache License 2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, MethodScope.make(this));
}
 
Example #13
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: Field.java    License: Apache License 2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    Class<?> c = getDeclaringClass();
    // create scope and factory
    return CoreReflectionFactory.make(c, ClassScope.make(c));
}
 
Example #14
Source Project: dragonwell8_jdk   Author: alibaba   File: Class.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, ClassScope.make(this));
}
 
Example #15
Source Project: java-n-IDE-for-Android   Author: shenghuntianlang   File: FieldRepository.java    License: Apache License 2.0 4 votes vote down vote up
protected FieldRepository(String rawSig, GenericsFactory f) {
  super(rawSig, f);
}
 
Example #16
Source Project: dragonwell8_jdk   Author: alibaba   File: Method.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, MethodScope.make(this));
}
 
Example #17
Source Project: dragonwell8_jdk   Author: alibaba   File: Field.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    Class<?> c = getDeclaringClass();
    // create scope and factory
    return CoreReflectionFactory.make(c, ClassScope.make(c));
}
 
Example #18
Source Project: dragonwell8_jdk   Author: alibaba   File: ConstructorRepository.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected ConstructorRepository(String rawSig, GenericsFactory f) {
  super(rawSig, f);
}
 
Example #19
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: LazyReflectiveObjectGenerator.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected LazyReflectiveObjectGenerator(GenericsFactory f) {
    factory = f;
}
 
Example #20
Source Project: java-n-IDE-for-Android   Author: shenghuntianlang   File: LazyReflectiveObjectGenerator.java    License: Apache License 2.0 4 votes vote down vote up
protected LazyReflectiveObjectGenerator(GenericsFactory f) {
    factory = f;
}
 
Example #21
Source Project: dragonwell8_jdk   Author: alibaba   File: ClassRepository.java    License: GNU General Public License v2.0 4 votes vote down vote up
private ClassRepository(String rawSig, GenericsFactory f) {
    super(rawSig, f);
}
 
Example #22
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: GenericDeclRepository.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected GenericDeclRepository(String rawSig, GenericsFactory f) {
    super(rawSig, f);
}
 
Example #23
Source Project: dragonwell8_jdk   Author: alibaba   File: GenericDeclRepository.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected GenericDeclRepository(String rawSig, GenericsFactory f) {
    super(rawSig, f);
}
 
Example #24
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ConstructorRepository.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected ConstructorRepository(String rawSig, GenericsFactory f) {
  super(rawSig, f);
}
 
Example #25
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: Method.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, MethodScope.make(this));
}
 
Example #26
Source Project: dragonwell8_jdk   Author: alibaba   File: LazyReflectiveObjectGenerator.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected LazyReflectiveObjectGenerator(GenericsFactory f) {
    factory = f;
}
 
Example #27
Source Project: dragonwell8_jdk   Author: alibaba   File: LazyReflectiveObjectGenerator.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    return factory;
}
 
Example #28
Source Project: TencentKona-8   Author: Tencent   File: Class.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, ClassScope.make(this));
}
 
Example #29
Source Project: TencentKona-8   Author: Tencent   File: Constructor.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, ConstructorScope.make(this));
}
 
Example #30
Source Project: TencentKona-8   Author: Tencent   File: Method.java    License: GNU General Public License v2.0 4 votes vote down vote up
private GenericsFactory getFactory() {
    // create scope and factory
    return CoreReflectionFactory.make(this, MethodScope.make(this));
}