public class DmoPropertyAccessor
extends java.lang.Object
implements org.hibernate.property.PropertyAccessor
This implementation uses the ReflectASM library to access DMO getter and setter methods through custom bytecode assembly.
Getter and setter methods invoked by this accessor must not throw exceptions.
Modifier and Type | Class and Description |
---|---|
private static class |
DmoPropertyAccessor.Access
A class containing the ReflectASM
MethodAccess object and information about
method indices and return types used to create accessor objects using shared instances of
MethodAccess . |
static class |
DmoPropertyAccessor.DmoGetter
Implementation of a
Getter which uses assembled bytecode to call a getter method
instead of Java reflection. |
static class |
DmoPropertyAccessor.DmoSetter
Implementation of a
Setter which uses assembled bytecode to call a setter method
instead of Java reflection. |
private static class |
DmoPropertyAccessor.Key
Key for
Getter and Setter cache maps. |
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.Class<?>,DmoPropertyAccessor.Access> |
accessCache
Cached information needed to create accessors using shared MethodAccess instances
|
private static java.util.Map<DmoPropertyAccessor.Key,DmoPropertyAccessor.DmoGetter> |
getters
Cached getter property accessors
|
private static java.util.Map<DmoPropertyAccessor.Key,DmoPropertyAccessor.DmoSetter> |
setters
Cached setter property accessors
|
Constructor and Description |
---|
DmoPropertyAccessor() |
Modifier and Type | Method and Description |
---|---|
private static DmoPropertyAccessor.Access |
createAccess(java.lang.Class<?> dmoClass)
Create a method access object for the given class, along with the information needed to
create getter and setter accessors using shared
MethodAccess instances. |
private static DmoPropertyAccessor.Access |
getAccess(java.lang.Class<?> dmoClass)
Get an
Access object, creating and caching it first if necessary. |
org.hibernate.property.Getter |
getGetter(java.lang.Class dmoClass,
java.lang.String property)
Return a
Getter Hibernate can use to read a DMO property. |
org.hibernate.property.Setter |
getSetter(java.lang.Class dmoClass,
java.lang.String property)
Return a
Setter Hibernate can use to write to a DMO property. |
private static final java.util.Map<java.lang.Class<?>,DmoPropertyAccessor.Access> accessCache
private static final java.util.Map<DmoPropertyAccessor.Key,DmoPropertyAccessor.DmoGetter> getters
private static final java.util.Map<DmoPropertyAccessor.Key,DmoPropertyAccessor.DmoSetter> setters
private static DmoPropertyAccessor.Access createAccess(java.lang.Class<?> dmoClass)
MethodAccess
instances.dmoClass
- DMO class for which accessors are needed.private static DmoPropertyAccessor.Access getAccess(java.lang.Class<?> dmoClass)
Access
object, creating and caching it first if necessary.dmoClass
- DMO class for which accessors are needed.public org.hibernate.property.Getter getGetter(java.lang.Class dmoClass, java.lang.String property)
Getter
Hibernate can use to read a DMO property.getGetter
in interface org.hibernate.property.PropertyAccessor
dmoClass
- DMO class for which access is needed.property
- Name of the DMO property to access.Getter
Hibernate can use to read a DMO property.org.hibernate.PropertyNotFoundException
- if the class is not a DMO or the property does not exist.public org.hibernate.property.Setter getSetter(java.lang.Class dmoClass, java.lang.String property)
Setter
Hibernate can use to write to a DMO property.getSetter
in interface org.hibernate.property.PropertyAccessor
dmoClass
- DMO class for which access is needed.property
- Name of the DMO property to access.Setter
Hibernate can use to write to a DMO property.org.hibernate.PropertyNotFoundException
- if the class is not a DMO or the property does not exist.