Package org.hibernate.models.spi
Class TypeDetailsHelper
java.lang.Object
org.hibernate.models.spi.TypeDetailsHelper
Helper utilities for dealing with TypeDetails
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayTypeDetailsarrayOf(TypeDetails constituentType, ModelsContext modelsContext) Make an array type of the given component typestatic TypeVariableDetailsfindTypeVariableDetails(String identifier, List<TypeVariableDetails> typeParameters) static ClassDetailsresolveRawClass(TypeDetails typeDetails) Given a type, resolve the underlying ClassDetailsstatic ClassBasedTypeDetailsresolveRelativeClassType(TypeDetails memberType, TypeVariableScope containerType) Very much the same as resolveRelativeType(TypeDetails, TypeVariableScope), except that here we resolve the relative type to the correspondingClassBasedTypeDetailswhich gives easy access to the type's ClassDetailsstatic TypeDetailsresolveRelativeType(TypeDetails type, TypeVariableScope container) Given an attribute member type and a concrete container type, resolve the type of the attribute relative to that container.static TypeDetailsresolveTypeVariableFromParameterizedType(ParameterizedTypeDetails parameterizedType, TypeVariableDetails typeVariable) Resolve a type variable's type relative to the provided parameterized type.
-
Constructor Details
-
TypeDetailsHelper
public TypeDetailsHelper()
-
-
Method Details
-
resolveRelativeType
Given an attribute member type and a concrete container type, resolve the type of the attribute relative to that container. For example, considerclass
Given this model, a call to resolve the type ofItem<T>{ T id; } class Hat extendsItem<Integer>{ ... }idrelative toHatwill returnClassTypeDetails(Integer). A call to resolve the type ofidrelative toItemreturnsParameterizedTypeDetails(T)(roughly Object) -
findTypeVariableDetails
public static TypeVariableDetails findTypeVariableDetails(String identifier, List<TypeVariableDetails> typeParameters) -
resolveRelativeClassType
public static ClassBasedTypeDetails resolveRelativeClassType(TypeDetails memberType, TypeVariableScope containerType) Very much the same as resolveRelativeType(TypeDetails, TypeVariableScope), except that here we resolve the relative type to the correspondingClassBasedTypeDetailswhich gives easy access to the type's ClassDetails -
resolveRawClass
Given a type, resolve the underlying ClassDetails- See Also:
-
resolveTypeVariableFromParameterizedType
public static TypeDetails resolveTypeVariableFromParameterizedType(ParameterizedTypeDetails parameterizedType, TypeVariableDetails typeVariable) Resolve a type variable's type relative to the provided parameterized type.- Parameters:
parameterizedType- the parameterized type used to resolve the type variable's relative typetypeVariable- the type variable to resolve- Returns:
- the type variable's relative type
-
arrayOf
Make an array type of the given component type
-