spring-framework / org.springframework.expression.spel.support / ReflectivePropertyAccessor / createOptimalAccessor

createOptimalAccessor

open fun createOptimalAccessor(evalContext: EvaluationContext, @Nullable target: Any, name: String): PropertyAccessor

Attempt to create an optimized property accessor tailored for a property of a particular name on a particular class. The general ReflectivePropertyAccessor will always work but is not optimal due to the need to lookup which reflective member (method/field) to use each time read() is called. This method will just return the ReflectivePropertyAccessor instance if it is unable to build something more optimal.