private synchronized void initGenericType() { if (!genericTypesAreInitialized) { String signatureAttribute = getSignatureAttribute(); GenericSignatureParser parser = new GenericSignatureParser( getDeclaringClass().getClassLoader()); parser.parseForField(this.getDeclaringClass(), signatureAttribute); genericType = parser.fieldType; if (genericType == null) { genericType = getType(); } genericTypesAreInitialized = true; } }
@SuppressWarnings("unchecked") private synchronized void initGenericTypes() { if (!genericTypesAreInitialized) { String signatureAttribute = getSignatureAttribute(); GenericSignatureParser parser = new GenericSignatureParser( getDeclaringClass().getClassLoader()); parser.parseForMethod(this, signatureAttribute, getExceptionTypes()); formalTypeParameters = parser.formalTypeParameters; genericParameterTypes = parser.parameterTypes; genericExceptionTypes = parser.exceptionTypes; genericReturnType = parser.returnType; genericTypesAreInitialized = true; } }
@SuppressWarnings("unchecked") private synchronized void initGenericTypes() { if (!genericTypesAreInitialized) { String signatureAttribute = getSignatureAttribute(); GenericSignatureParser parser = new GenericSignatureParser( getDeclaringClass().getClassLoader()); parser.parseForConstructor(this, signatureAttribute, getExceptionTypes()); formalTypeParameters = parser.formalTypeParameters; genericParameterTypes = parser.parameterTypes; genericExceptionTypes = parser.exceptionTypes; genericTypesAreInitialized = true; } }
/** * Returns the {@code Type} that represents the superclass of this {@code * class}. */ public Type getGenericSuperclass() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getType(parser.superclassType); }
/** * Returns an array containing {@code TypeVariable} objects for type * variables declared by the generic class represented by this {@code * Class}. Returns an empty array if the class is not generic. */ @SuppressWarnings("unchecked") public synchronized TypeVariable<Class<T>>[] getTypeParameters() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return parser.formalTypeParameters.clone(); }
/** * Returns the {@link Type}s of the interfaces that this {@code Class} directly * implements. If the {@code Class} represents a primitive type or {@code * void} then an empty array is returned. */ public Type[] getGenericInterfaces() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getTypeArray(parser.interfaceTypes, true); }
private synchronized void initGenericType() { if (!genericTypesAreInitialized) { String signatureAttribute = getSignatureAttribute(); GenericSignatureParser parser = new GenericSignatureParser( getDeclaringClass().getClassLoader()); parser.parseForField(this.getDeclaringClass(), signatureAttribute); genericType = parser.fieldType; if (genericType == null) { genericType = getType(); } genericTypesAreInitialized = true; } }
@SuppressWarnings("unchecked") private synchronized void initGenericTypes() { if (!genericTypesAreInitialized) { String signatureAttribute = getSignatureAttribute(); GenericSignatureParser parser = new GenericSignatureParser( getDeclaringClass().getClassLoader()); parser.parseForMethod(this, signatureAttribute, getExceptionTypes()); formalTypeParameters = parser.formalTypeParameters; genericParameterTypes = parser.parameterTypes; genericExceptionTypes = parser.exceptionTypes; genericReturnType = parser.returnType; genericTypesAreInitialized = true; } }
/** * Returns the {@link Type}s of the interfaces that this {@code Class} directly * implements. If the {@code Class} represents a primitive type or {@code * void} then an empty array is returned. */ public Type[] getGenericInterfaces() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getTypeArray(parser.interfaceTypes, true); }
/** * Returns an array containing {@code TypeVariable} objects for type * variables declared by the generic class represented by this {@code * Class}. Returns an empty array if the class is not generic. */ @SuppressWarnings("unchecked") public synchronized TypeVariable<Class<T>>[] getTypeParameters() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return parser.formalTypeParameters.clone(); }
/** * Returns the {@code Type} that represents the superclass of this {@code * class}. */ public Type getGenericSuperclass() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getType(parser.superclassType); }
/** * Returns the {@code Type} that represents the superclass of this {@code * class}. */ public Type getGenericSuperclass() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getType(parser.superclassType); }
/** * Returns an array containing {@code TypeVariable} objects for type * variables declared by the generic class represented by this {@code * Class}. Returns an empty array if the class is not generic. */ @SuppressWarnings("unchecked") public synchronized TypeVariable<Class<T>>[] getTypeParameters() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return parser.formalTypeParameters.clone(); }
/** * Returns the {@code Type} that represents the superclass of this {@code * class}. */ public Type getGenericSuperclass() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getType(parser.superclassType); }
/** * Returns an array containing {@code TypeVariable} objects for type * variables declared by the generic class represented by this {@code * Class}. Returns an empty array if the class is not generic. */ @SuppressWarnings("unchecked") public synchronized TypeVariable<Class<T>>[] getTypeParameters() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return parser.formalTypeParameters.clone(); }
/** * Returns the {@link Type}s of the interfaces that this {@code Class} directly * implements. If the {@code Class} represents a primitive type or {@code * void} then an empty array is returned. */ public Type[] getGenericInterfaces() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getTypeArray(parser.interfaceTypes, true); }
/** * Returns an array containing {@code TypeVariable} objects for type * variables declared by the generic class represented by this {@code * Class}. Returns an empty array if the class is not generic. */ @SuppressWarnings("unchecked") public synchronized TypeVariable<Class<T>>[] getTypeParameters() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return parser.formalTypeParameters.clone(); }
/** * Returns the {@link Type}s of the interfaces that this {@code Class} directly * implements. If the {@code Class} represents a primitive type or {@code * void} then an empty array is returned. */ public Type[] getGenericInterfaces() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getTypeArray(parser.interfaceTypes, true); }
/** * Returns the {@link Type}s of the interfaces that this {@code Class} directly * implements. If the {@code Class} represents a primitive type or {@code * void} then an empty array is returned. */ public Type[] getGenericInterfaces() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return Types.getTypeArray(parser.interfaceTypes, true); }
/** * Returns an array containing {@code TypeVariable} objects for type * variables declared by the generic class represented by this {@code * Class}. Returns an empty array if the class is not generic. */ @SuppressWarnings("unchecked") public synchronized TypeVariable<Class<T>>[] getTypeParameters() { GenericSignatureParser parser = new GenericSignatureParser(getClassLoader()); parser.parseForClass(this, getSignatureAttribute()); return parser.formalTypeParameters.clone(); }