Class GetterFactory

java.lang.Object
org.klojang.invoke.GetterFactory

public final class GetterFactory extends Object
Assembles, caches, and supplies getters for classes.
Author:
Ayco Holleman
  • Field Details

    • INSTANCE

      public static final GetterFactory INSTANCE
      The one and only instance of GetterFactory.
  • Method Details

    • getGetters

      public Map<String,Getter> getGetters(Class<?> clazz, boolean strict)
      Returns the public getters for the specified class. The returned Map maps property names to Getter instances.
      Parameters:
      clazz - the class for which to retrieve the public getters
      strict - if false, all non-static methods with a zero-length parameter list and a non-void return type, except getClass(), hashCode() and toString(), will be regarded as getters. Otherwise JavaBeans naming conventions will be applied regarding which methods qualify as getters, with the exception that methods returning a Boolean are allowed to have a name starting with "is". For record types, getters are collected as though with strict equal to false.
      Returns:
      the public getters of the specified class
      Throws:
      IllegalAssignmentException - if the does not have any public getters