Package net.bytebuddy.description.type
Interface TypeDescription.ForLoadedType.Dispatcher
- Enclosing class:
TypeDescription.ForLoadedType
@Defaults
@Proxied("java.lang.Class")
protected static interface TypeDescription.ForLoadedType.Dispatcher
A dispatcher for using methods of
Class
that are not declared for Java 6.-
Method Summary
Modifier and TypeMethodDescriptiongetAnnotatedInterfaces
(Class<?> type) Resolves the annotated interfaces of the supplied type.getAnnotatedSuperclass
(Class<?> type) Resolves the annotated super class of the supplied type.Class
<?> getNestHost
(Class<?> type) Returns the specified class's nest host.Class<?>[]
getNestMembers
(Class<?> type) Returns the nest members of the other class.Class<?>[]
getPermittedSubclasses
(Class<?> type) Returns the permitted subclasses of the supplied type.Object[]
getRecordComponents
(Class<?> type) Resolves a type's record components.boolean
isNestmateOf
(Class<?> type, Class<?> candidate) Returnstrue
if the specified type is a nest mate of the other type.boolean
Checks if the supplied type is a record.boolean
Checks if this type is sealed.
-
Method Details
-
getAnnotatedSuperclass
Resolves the annotated super class of the supplied type.- Parameters:
type
- The type to resolve.- Returns:
- The annotated super class of the supplied type or
null
if this feature is not supported.
-
getAnnotatedInterfaces
Resolves the annotated interfaces of the supplied type.- Parameters:
type
- The type to resolve.- Returns:
- An array of the type's annotated interfaces or an empty array if this feature is not supported.
-
getNestHost
Returns the specified class's nest host.- Parameters:
type
- The class for which to locate the nest host.- Returns:
- The nest host of the specified class.
-
getNestMembers
Returns the nest members of the other class.- Parameters:
type
- The type to get the nest members for.- Returns:
- An array containing all nest members of the specified type's nest group.
-
isNestmateOf
Returnstrue
if the specified type is a nest mate of the other type.- Parameters:
type
- The type to evaluate for being a nest mate of another type.candidate
- The candidate type.- Returns:
true
if the specified type is a nest mate of the other class.
-
isSealed
Checks if this type is sealed. This will always befalse
if the current VM does not support sealed classes.- Parameters:
type
- The type to check- Returns:
true
if the supplied type is sealed.
-
getPermittedSubclasses
Returns the permitted subclasses of the supplied type.- Parameters:
type
- The type for which to check the permitted subclasses.- Returns:
- The permitted subclasses.
-
isRecord
Checks if the supplied type is a record.- Parameters:
type
- The type to resolve.- Returns:
true
if the supplied type is a record.
-
getRecordComponents
Resolves a type's record components.- Parameters:
type
- The type for which to read the record components.- Returns:
- An array of all declared record components.
-