Skip to content

ReflectiveMethodResolver should provide a MethodFilter strategy [SPR-6764] #11430

@spring-projects-issues

Description

@spring-projects-issues

Mark Fisher opened SPR-6764 and commented

It would be convenient if the resolver implementation provided a hook for more fine-grained control. What I have done in the meantime is added the following:

public MethodExecutor resolve(EvaluationContext context,
      Object targetObject, String name, Class<?>[] argumentTypes) throws AccessException {

   try {
      TypeConverter typeConverter = context.getTypeConverter();
      Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass());

      // added this for Spring Integration message processor
      Method[] methods = ObjectUtils.containsElement(this.filteredTypes, type) ?
            this.methodFilter.filter(type.getMethods()) : type.getMethods();
   ...

Affects: 3.0 GA

Referenced from: commits 66f7083

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions