AccessOptimizerAdapterpublic class AccessOptimizerAdapter extends Object implements Serializable, ReflectionOptimizer.AccessOptimizerThe {@link ReflectionOptimizer.AccessOptimizer} implementation for Javassist
which simply acts as an adpater to the {@link BulkAccessor} class. |
Fields Summary |
---|
public static final String | PROPERTY_GET_EXCEPTION | public static final String | PROPERTY_SET_EXCEPTION | private final BulkAccessor | bulkAccessor | private final Class | mappedClass |
Constructors Summary |
---|
public AccessOptimizerAdapter(BulkAccessor bulkAccessor, Class mappedClass)
this.bulkAccessor = bulkAccessor;
this.mappedClass = mappedClass;
|
Methods Summary |
---|
public java.lang.String[] | getPropertyNames()
return bulkAccessor.getGetters();
| public java.lang.Object[] | getPropertyValues(java.lang.Object object)
try {
return bulkAccessor.getPropertyValues( object );
}
catch ( Throwable t ) {
throw new PropertyAccessException(
t,
PROPERTY_GET_EXCEPTION,
false,
mappedClass,
getterName( t, bulkAccessor )
);
}
| private static java.lang.String | getterName(java.lang.Throwable t, BulkAccessor accessor)
if (t instanceof BulkAccessorException ) {
return accessor.getGetters()[ ( (BulkAccessorException) t ).getIndex() ];
}
else {
return "?";
}
| public void | setPropertyValues(java.lang.Object object, java.lang.Object[] values)
try {
bulkAccessor.setPropertyValues( object, values );
}
catch ( Throwable t ) {
throw new PropertyAccessException(
t,
PROPERTY_SET_EXCEPTION,
true,
mappedClass,
setterName( t, bulkAccessor )
);
}
| private static java.lang.String | setterName(java.lang.Throwable t, BulkAccessor accessor)
if (t instanceof BulkAccessorException ) {
return accessor.getSetters()[ ( (BulkAccessorException) t ).getIndex() ];
}
else {
return "?";
}
|
|