Package org.apache.commons.ognl
Class OgnlCache
java.lang.Object
org.apache.commons.ognl.OgnlCache
This class takes care of all the internal caching for OGNL.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cache
<Constructor<?>, Class<?>[]> private final ClassCache
<Map<String, Field>> private final Cache
<GenericMethodParameterTypeCacheEntry, Class<?>[]> private final Cache
<PermissionCacheEntry, Permission> private final Cache
<Method, MethodAccessEntryValue> private final CacheFactory
private final ClassCache
<List<Constructor<?>>> private final ClassCache
<ElementsAccessor> private final ClassCache
<MethodAccessor> private final MethodPermCacheEntryFactory
private final ClassCache
<NullHandler> private final ClassCache
<PropertyAccessor> (package private) final ClassCache
<Map<String, PropertyDescriptor>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
List
<Constructor<?>> getConstructor
(Class<?> clazz) getElementsAccessor
(Class<?> clazz) Class<?>[]
getInvokePermission
(PermissionCacheEntry permissionCacheEntry) getMethod
(DeclaredMethodCacheEntry declaredMethodCacheEntry) getMethodAccess
(Method method) getMethodAccessor
(Class<?> clazz) Class<?>[]
getMethodParameterTypes
(Method method) boolean
getMethodPerm
(Method method) getNullHandler
(Class<?> clazz) Class<?>[]
getParameterTypes
(Constructor<?> constructor) getPropertyAccessor
(Class<?> clazz) getPropertyDescriptor
(Class<?> clazz) void
setClassCacheInspector
(ClassCacheInspector inspector) Registers the specifiedClassCacheInspector
with all class reflection based internal caches.void
setElementsAccessor
(Class<?> clazz, ElementsAccessor accessor) void
setMethodAccessor
(Class<?> clazz, MethodAccessor accessor) void
setNullHandler
(Class<?> clazz, NullHandler handler) void
setPropertyAccessor
(Class<?> clazz, PropertyAccessor accessor) void
setSecurityManager
(SecurityManager securityManager)
-
Field Details
-
cacheFactory
-
methodAccessors
-
propertyAccessors
-
elementsAccessors
-
nullHandlers
-
propertyDescriptorCache
-
constructorCache
-
_methodCache
-
_invokePermissionCache
-
_fieldCache
-
_methodParameterTypesCache
-
_genericMethodParameterTypesCache
private final Cache<GenericMethodParameterTypeCacheEntry,Class<?>[]> _genericMethodParameterTypesCache -
_ctorParameterTypesCache
-
_methodAccessCache
-
methodPermCacheEntryFactory
-
_methodPermCache
-
-
Constructor Details
-
OgnlCache
public OgnlCache()
-
-
Method Details
-
getMethodParameterTypes
- Throws:
CacheException
-
getParameterTypes
- Throws:
CacheException
-
getConstructor
- Throws:
CacheException
-
getField
- Throws:
CacheException
-
getMethod
public Map<String,List<Method>> getMethod(DeclaredMethodCacheEntry declaredMethodCacheEntry) throws CacheException - Throws:
CacheException
-
getPropertyDescriptor
- Throws:
CacheException
-
getInvokePermission
public Permission getInvokePermission(PermissionCacheEntry permissionCacheEntry) throws CacheException - Throws:
CacheException
-
getMethodAccessor
- Throws:
OgnlException
-
setMethodAccessor
-
setPropertyAccessor
-
getPropertyAccessor
- Throws:
OgnlException
-
setClassCacheInspector
Registers the specifiedClassCacheInspector
with all class reflection based internal caches. This may have a significant performance impact so be careful using this in production scenarios.- Parameters:
inspector
- The inspector instance that will be registered with all internal cache instances.
-
getGenericMethodParameterTypes
public Class<?>[] getGenericMethodParameterTypes(GenericMethodParameterTypeCacheEntry key) throws CacheException - Throws:
CacheException
-
getMethodPerm
- Throws:
CacheException
-
getMethodAccess
- Throws:
CacheException
-
clear
public void clear() -
getElementsAccessor
- Throws:
OgnlException
-
setElementsAccessor
-
getNullHandler
- Throws:
OgnlException
-
setNullHandler
-
setSecurityManager
-