Package ome.services.graphs
Class GraphPathBean
- java.lang.Object
-
- ome.tools.spring.OnContextRefreshedEventListener
-
- ome.services.graphs.GraphPathBean
-
- All Implemented Interfaces:
java.util.EventListener
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
public class GraphPathBean extends OnContextRefreshedEventListener
The graph path bean holds the Hibernate object mapping and assists navigation thereof.- Since:
- 5.1.0
-
-
Constructor Summary
Constructors Constructor Description GraphPathBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Collection<java.lang.String>
getAllClasses()
Get all the classes mapped by Hibernate.java.lang.Class<? extends ome.model.IObject>
getClassForSimpleName(java.lang.String simpleName)
java.util.Set<java.lang.String>
getDirectSubclassesOf(java.lang.String className)
Get the direct subclasses of the given class, if any.java.lang.String
getDirectSuperclassOf(java.lang.String className)
Get the direct superclass of the given class, if any.java.lang.String
getIdentifierProperty(java.lang.String className)
Get the identifier property for the given class.java.lang.String
getInterfaceImplemented(java.lang.String className, java.lang.String propertyName)
Get the interface whose method is implemented by a specific class property, if any.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
getLinkedBy(java.lang.String className)
Get the classes and properties that link to the given class.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
getLinkedTo(java.lang.String className)
Get the classes and properties to which the given class links.ome.services.graphs.GraphPathBean.PropertyKind
getPropertyKind(java.lang.String className, java.lang.String propertyName)
Get what kind of property a specific class property is.org.hibernate.type.Type
getPropertyType(java.lang.String className, java.lang.String propertyName)
Get the Hibernate type of a specific class property.java.util.Set<java.lang.String>
getSimpleProperties(java.lang.String className)
Deprecated.java.util.Set<java.lang.String>
getSimpleProperties(java.lang.String className, boolean isNested)
Get thesimple
properties for the given class, not linking to other mapped classes.java.util.Set<java.lang.String>
getSubclassesOf(java.lang.String className)
Get the subclasses of the given class, if any.java.util.Collection<java.lang.String>
getSubclassesOfReflexive(java.lang.String className)
Get the name of this class and of its mapped subclasses.java.util.Set<java.lang.String>
getSuperclassesOf(java.lang.String className)
Get the superclasses of the given class, if any.java.util.Collection<java.lang.String>
getSuperclassesOfReflexive(java.lang.String className)
Get the name of this class and of its mapped superclasses.void
handleContextRefreshedEvent(org.springframework.context.event.ContextRefreshedEvent event)
The application context after refresh should contain a usable Hibernate session factory.boolean
isPropertyAccessible(java.lang.String className, java.lang.String propertyName)
Find if the given property can be accessed.-
Methods inherited from class ome.tools.spring.OnContextRefreshedEventListener
onApplicationEvent, setApplicationContext
-
-
-
-
Method Detail
-
handleContextRefreshedEvent
public void handleContextRefreshedEvent(org.springframework.context.event.ContextRefreshedEvent event)
The application context after refresh should contain a usable Hibernate session factory. If not already done, process the Hibernate domain object model from that bean.- Specified by:
handleContextRefreshedEvent
in classOnContextRefreshedEventListener
- Parameters:
event
- the context refreshed event bearing the new application context
-
getClassForSimpleName
public java.lang.Class<? extends ome.model.IObject> getClassForSimpleName(java.lang.String simpleName)
- Parameters:
simpleName
- the simple name of a mapped IObject class- Returns:
- the class with that simple name, or
null
if one is not known
-
getAllClasses
public java.util.Collection<java.lang.String> getAllClasses()
Get all the classes mapped by Hibernate.- Returns:
- the classes
-
getDirectSuperclassOf
public java.lang.String getDirectSuperclassOf(java.lang.String className)
Get the direct superclass of the given class, if any.- Parameters:
className
- the name of a class- Returns:
- the class' direct superclass, may be
null
-
getSuperclassesOf
public java.util.Set<java.lang.String> getSuperclassesOf(java.lang.String className)
Get the superclasses of the given class, if any.- Parameters:
className
- the name of a class- Returns:
- the class' superclasses, never
null
-
getSuperclassesOfReflexive
public java.util.Collection<java.lang.String> getSuperclassesOfReflexive(java.lang.String className)
Get the name of this class and of its mapped superclasses.- Parameters:
className
- the name of a class- Returns:
- the class and its superclasses, never
null
-
getDirectSubclassesOf
public java.util.Set<java.lang.String> getDirectSubclassesOf(java.lang.String className)
Get the direct subclasses of the given class, if any.- Parameters:
className
- the name of a class- Returns:
- the class' direct subclasses, never
null
-
getSubclassesOf
public java.util.Set<java.lang.String> getSubclassesOf(java.lang.String className)
Get the subclasses of the given class, if any.- Parameters:
className
- the name of a class- Returns:
- the class' subclasses, never
null
-
getSubclassesOfReflexive
public java.util.Collection<java.lang.String> getSubclassesOfReflexive(java.lang.String className)
Get the name of this class and of its mapped subclasses.- Parameters:
className
- the name of a class- Returns:
- the class and its subclasses, never
null
-
getLinkedTo
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getLinkedTo(java.lang.String className)
Get the classes and properties to which the given class links.- Parameters:
className
- the name of a class- Returns:
- the classes to which the given class links, and by which properties; never
null
-
getLinkedBy
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getLinkedBy(java.lang.String className)
Get the classes and properties that link to the given class.- Parameters:
className
- the name of a class- Returns:
- the classes that link to the given class, and by which properties; never
null
-
getPropertyKind
public ome.services.graphs.GraphPathBean.PropertyKind getPropertyKind(java.lang.String className, java.lang.String propertyName)
Get what kind of property a specific class property is.- Parameters:
className
- the name of a classpropertyName
- the name of a property declared, not just inherited, by that class- Returns:
- the kind of property it is
-
getPropertyType
public org.hibernate.type.Type getPropertyType(java.lang.String className, java.lang.String propertyName)
Get the Hibernate type of a specific class property.- Parameters:
className
- the name of a classpropertyName
- the name of a property declared, not just inherited, by that class- Returns:
- the Hibernate type of the property
-
getInterfaceImplemented
public java.lang.String getInterfaceImplemented(java.lang.String className, java.lang.String propertyName)
Get the interface whose method is implemented by a specific class property, if any.- Parameters:
className
- the name of a classpropertyName
- the name of a property declared, not just inherited, by that class- Returns:
- the implemented interface, may be
null
-
isPropertyAccessible
public boolean isPropertyAccessible(java.lang.String className, java.lang.String propertyName)
Find if the given property can be accessed.- Parameters:
className
- the name of a classpropertyName
- the name of a property declared, not just inherited, by that class- Returns:
- if the property can be accessed
-
getIdentifierProperty
public java.lang.String getIdentifierProperty(java.lang.String className)
Get the identifier property for the given class.- Parameters:
className
- the name of a class- Returns:
- the identifier property, or
null
if one is not known
-
getSimpleProperties
@Deprecated public java.util.Set<java.lang.String> getSimpleProperties(java.lang.String className)
Deprecated.Get thesimple
non-nested properties for the given class, not linking to other mapped classes.- Parameters:
className
- the name of a class- Returns:
- the
simple
properties of the given class; nevernull
-
getSimpleProperties
public java.util.Set<java.lang.String> getSimpleProperties(java.lang.String className, boolean isNested)
Get thesimple
properties for the given class, not linking to other mapped classes.- Parameters:
className
- the name of a classisNested
- if nested properties should have all components given separately with dot-notation- Returns:
- the
simple
properties of the given class; nevernull
-
-