Skip to content

io microsphere reflect generics ParameterizedTypeImpl

github-actions[bot] edited this page Mar 24, 2026 · 3 revisions

ParameterizedTypeImpl

Type: Class | Module: microsphere-java-core | Package: io.microsphere.reflect.generics | Since: 1.0.0

Source: microsphere-java-core/src/main/java/io/microsphere/reflect/generics/ParameterizedTypeImpl.java

Overview

ParameterizedType Implementation forks sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl

Declaration

public class ParameterizedTypeImpl implements ParameterizedType

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.2-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 8 ✅ Compatible
Java 11 ✅ Compatible
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-java-core</artifactId>
    <version>${microsphere-java.version}</version>
</dependency>

Tip: Use the BOM (microsphere-java-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.reflect.generics.ParameterizedTypeImpl;

API Reference

Public Methods

Method Description
of Static factory. Given a (generic) class, actual type arguments
of Static factory. Given a (generic) class, actual type arguments
getActualTypeArguments Returns an array of Type objects representing the actual type
getRawType Returns the Type object representing the class or interface
getOwnerType Returns a Type object representing the type that this type

Method Details

of

public static ParameterizedTypeImpl of(Class<?> rawType, Type... actualTypeArguments)

Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type.

This method throws a MalformedParameterizedTypeException under the following circumstances: If the number of actual type arguments (i.e., the size of the array typeArgs) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.

of

public static ParameterizedTypeImpl of(Class<?> rawType, Type[] actualTypeArguments, Type ownerType)

Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type.

This method throws a MalformedParameterizedTypeException under the following circumstances: If the number of actual type arguments (i.e., the size of the array typeArgs) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.

getActualTypeArguments

public Type[] getActualTypeArguments()

Returns an array of Type objects representing the actual type arguments to this type.

Note that in some cases, the returned array be empty. This can occur if this type represents a non-parameterized type nested within a parameterized type.

Since: 1.5

getRawType

public Class<?> getRawType()

Returns the Type object representing the class or interface that declared this type.

getOwnerType

public Type getOwnerType()

Returns a Type object representing the type that this type is a member of. For example, if this type is O.I, return a representation of O.

If this type is a top-level type, null is returned.

See Also

  • ParameterizedType
  • sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl

This documentation was auto-generated from the source code of microsphere-java.

Home

annotation-processor

java-annotations

java-core

java-test

jdk-tools

lang-model

Clone this wiki locally