Package org.hibernate.models.internal
Class AbstractClassDetailsRegistry
java.lang.Object
org.hibernate.models.internal.AbstractClassDetailsRegistry
- All Implemented Interfaces:
MutableClassDetailsRegistry,ClassDetailsRegistry
- Direct Known Subclasses:
ClassDetailsRegistryStandard
public abstract class AbstractClassDetailsRegistry
extends Object
implements MutableClassDetailsRegistry
Base ClassDetailsRegistry implementation support
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.models.spi.ClassDetailsRegistry
ClassDetailsRegistry.ClassDetailsConsumerNested classes/interfaces inherited from interface org.hibernate.models.internal.MutableClassDetailsRegistry
MutableClassDetailsRegistry.ClassDetailsCreator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, ClassDetails> protected final ModelsContextprotected final Map<String, Set<ClassDetails>> protected final Map<String, Set<ClassDetails>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractClassDetailsRegistry(boolean trackImplementors, Map<String, ClassDetails> classDetailsMap, Map<String, Set<ClassDetails>> directSubtypeMap, Map<String, Set<ClassDetails>> directImplementorMap, ModelsContext context) protectedAbstractClassDetailsRegistry(boolean trackImplementors, ModelsContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassDetails(String name, ClassDetails classDetails) Adds a managed-class descriptor using the givennameas the registration keyvoidaddClassDetails(ClassDetails classDetails) Adds a managed-class descriptor using its name as the registration key.collectImplementors(String base, boolean includeBase, Predicate<ClassDetails> exclusions) Walks the inheritance tree, starting frombase, "downward" calling the consumer for each subclass and interface which is directly an implementor.protected ClassDetailscreateClassDetails(String name) protected ClassDetailsfindClassDetails(String name) Find the managed-class with the givenname, if there is one.voidVisit each registered class detailsvoidforEachDirectImplementor(String interfaceName, ClassDetailsRegistry.ClassDetailsConsumer consumer) Visit each direct implementor, including specializations, of the named interface.voidforEachDirectSubtype(String typeName, ClassDetailsRegistry.ClassDetailsConsumer consumer) Visit each direct subtype of the named managed-classgetDirectImplementors(String interfaceName) Get the list of all direct implementors, including specializations, for the named interface.getDirectSubtypes(String typeName) Get the list of all direct subtypes for the named managed-class.getDirectSubTypes(String typeName) Get the list of all direct subtypes for the named managed-class.booleanWhether this registry is tracking interface implementors.resolveClassDetails(String name) Resolves a managed-class by name.Resolve (find or create) ClassDetails by name.voidwalkConcreteTypes(String base, boolean includeBase, ClassDetailsRegistry.ClassDetailsConsumer consumer) Visit all concrete (non-abstract, non-interface) ClassDetails from the give base type.voidwalkImplementors(String base, boolean includeBase, ClassDetailsRegistry.ClassDetailsConsumer consumer) Walks the inheritance tree downward, starting frombase, calling the consumer for each subclass and interface which is directly an implementor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.models.spi.ClassDetailsRegistry
as, collectImplementors, findConcreteTypes, findConcreteTypes, forEachDirectSubType, getClassDetails, getClassDetailsBuilder
-
Field Details
-
context
-
classDetailsMap
-
directSubtypeMap
-
directImplementorMap
-
-
Constructor Details
-
AbstractClassDetailsRegistry
-
AbstractClassDetailsRegistry
protected AbstractClassDetailsRegistry(boolean trackImplementors, Map<String, ClassDetails> classDetailsMap, Map<String, Set<ClassDetails>> directSubtypeMap, Map<String, Set<ClassDetails>> directImplementorMap, ModelsContext context)
-
-
Method Details
-
isTrackingImplementors
public boolean isTrackingImplementors()Description copied from interface:ClassDetailsRegistryWhether this registry is tracking interface implementors.- Specified by:
isTrackingImplementorsin interfaceClassDetailsRegistry- See Also:
-
getDirectSubTypes
Description copied from interface:ClassDetailsRegistryGet the list of all direct subtypes for the named managed-class.- Specified by:
getDirectSubTypesin interfaceClassDetailsRegistry
-
getDirectSubtypes
Description copied from interface:ClassDetailsRegistryGet the list of all direct subtypes for the named managed-class.- Specified by:
getDirectSubtypesin interfaceClassDetailsRegistry
-
forEachDirectSubtype
public void forEachDirectSubtype(String typeName, ClassDetailsRegistry.ClassDetailsConsumer consumer) Description copied from interface:ClassDetailsRegistryVisit each direct subtype of the named managed-class- Specified by:
forEachDirectSubtypein interfaceClassDetailsRegistry
-
getDirectImplementors
Description copied from interface:ClassDetailsRegistryGet the list of all direct implementors, including specializations, for the named interface.- Specified by:
getDirectImplementorsin interfaceClassDetailsRegistry- Returns:
- The direct implementors of the named interface.
- See Also:
-
forEachDirectImplementor
public void forEachDirectImplementor(String interfaceName, ClassDetailsRegistry.ClassDetailsConsumer consumer) Description copied from interface:ClassDetailsRegistryVisit each direct implementor, including specializations, of the named interface.- Specified by:
forEachDirectImplementorin interfaceClassDetailsRegistry- See Also:
-
walkConcreteTypes
public void walkConcreteTypes(String base, boolean includeBase, ClassDetailsRegistry.ClassDetailsConsumer consumer) Description copied from interface:ClassDetailsRegistryVisit all concrete (non-abstract, non-interface) ClassDetails from the give base type.- Specified by:
walkConcreteTypesin interfaceClassDetailsRegistry- Parameters:
base- The name of the class/interface from which to start walking.includeBase- Whether to includebaseif it is concrete type.consumer- The callback for each concrete ClassDetails
-
collectImplementors
public Set<ClassDetails> collectImplementors(String base, boolean includeBase, Predicate<ClassDetails> exclusions) Description copied from interface:ClassDetailsRegistryWalks the inheritance tree, starting frombase, "downward" calling the consumer for each subclass and interface which is directly an implementor.- Specified by:
collectImplementorsin interfaceClassDetailsRegistry- Parameters:
base- The type from which to start.includeBase- Whether to includebaseif it is concrete type.exclusions- Exclusive check to filter ClassDetails out of the result.- See Also:
-
walkImplementors
public void walkImplementors(String base, boolean includeBase, ClassDetailsRegistry.ClassDetailsConsumer consumer) Description copied from interface:ClassDetailsRegistryWalks the inheritance tree downward, starting frombase, calling the consumer for each subclass and interface which is directly an implementor.- Specified by:
walkImplementorsin interfaceClassDetailsRegistry- Parameters:
base- The type from which to start.includeBase- Whether to includebaseif it is concrete type.consumer- The callback.- See Also:
-
findClassDetails
Description copied from interface:ClassDetailsRegistryFind the managed-class with the givenname, if there is one. Returnsnullif there are none registered with that name.- Specified by:
findClassDetailsin interfaceClassDetailsRegistry
-
forEachClassDetails
Description copied from interface:ClassDetailsRegistryVisit each registered class details- Specified by:
forEachClassDetailsin interfaceClassDetailsRegistry
-
resolveClassDetails
Description copied from interface:ClassDetailsRegistryResolves a managed-class by name. If there is currently no such registration, one is created.- Specified by:
resolveClassDetailsin interfaceClassDetailsRegistry
-
createClassDetails
-
addClassDetails
Description copied from interface:MutableClassDetailsRegistryAdds a managed-class descriptor using its name as the registration key.- Specified by:
addClassDetailsin interfaceMutableClassDetailsRegistry
-
addClassDetails
Description copied from interface:MutableClassDetailsRegistryAdds a managed-class descriptor using the givennameas the registration key- Specified by:
addClassDetailsin interfaceMutableClassDetailsRegistry
-
resolveClassDetails
public ClassDetails resolveClassDetails(String name, MutableClassDetailsRegistry.ClassDetailsCreator creator) Description copied from interface:MutableClassDetailsRegistryResolve (find or create) ClassDetails by name. If there is currently no such registration, one is created using the specifiedcreator.- Specified by:
resolveClassDetailsin interfaceMutableClassDetailsRegistry
-
createClassDetails
protected ClassDetails createClassDetails(String name, MutableClassDetailsRegistry.ClassDetailsCreator creator) -
classDetailsMap
-
getClassDetailsMap
-
getDirectSubTypeMap
-
getDirectImplementorMap
-