Interface TargetedAccessor

All Known Subinterfaces:
CompilableIndexAccessor, CompilablePropertyAccessor, IndexAccessor, PropertyAccessor
All Known Implementing Classes:
BeanExpressionContextAccessor, BeanFactoryAccessor, DataBindingPropertyAccessor, EnvironmentAccessor, MapAccessor, ReflectiveIndexAccessor, ReflectivePropertyAccessor

public interface TargetedAccessor
Strategy for types that access elements of specific target classes.

This interface places no restrictions on what constitutes an element.

A targeted accessor can specify a set of target classes for which it should be called. However, if it returns null or an empty array from getSpecificTargetClasses(), it will typically be called for all access operations and given a chance to determine if it supports a concrete access attempt.

Targeted accessors are considered to be ordered, and each will be called in turn. The only rule that affects the call order is that any accessor which specifies explicit support for a given target class via getSpecificTargetClasses() will be called first, before other generic accessors that do not specify explicit support for the given target class.

Since:
6.2
Author:
Sam Brannen
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Class<?>[]
    Get the set of classes for which this accessor should be called.
  • Method Details

    • getSpecificTargetClasses

      @Nullable Class<?>[] getSpecificTargetClasses()
      Get the set of classes for which this accessor should be called.

      Returning null or an empty array indicates this is a generic accessor that can be called in an attempt to access an element on any type.

      Returns:
      an array of classes that this accessor is suitable for (or null or an empty array if a generic accessor)