Class DefaultBindableCache

java.lang.Object
org.tentackle.bind.DefaultBindableCache
All Implemented Interfaces:
BindableCache

public class DefaultBindableCache extends Object implements BindableCache
Default implementation of the cache for bindable elements per class.

Annotated getters, setters, "from"- or "with"-methods and fields of the same name are merged into a single element. For records, the "from"- or "with"-method of an annotated component is detected automatically.

Author:
harald
  • Constructor Details

    • DefaultBindableCache

      public DefaultBindableCache(BindingFactory bindingFactory)
      Creates a bindable cache.
      Parameters:
      bindingFactory - the binding factory to create binding elements
  • Method Details

    • getBindableMap

      public Collection<BindableElement> getBindableMap(Class<?> clazz, boolean declaredOnly)
      Gets the map of bindables for the given class.
      Specified by:
      getBindableMap in interface BindableCache
      Parameters:
      clazz - the class to retrieve the bindables for
      declaredOnly - true if only declared elements, else inherited as well
      Returns:
      the elements
      Throws:
      BindingException - if more than one setter or "from"-method is annotated for the same element