Class AnnotatedIdFiller

java.lang.Object
me.ahoo.cosid.internal.AnnotatedIdFiller
All Implemented Interfaces:
IdFiller

public final class AnnotatedIdFiller extends Object implements IdFiller
Fills the CosId field of an entity (07-runtime-and-spring.md ยง3). The accessor of a class is resolved on its first fill and cached per class: the annotated field (on the field, or on a type naming it) is looked up along the superclasses, its type resolved through generic superclasses, and read and written through its getter and setter if it has them, else directly. A class has at most one id; a class without one is left as it is.
  • Constructor Details

    • AnnotatedIdFiller

      public AnnotatedIdFiller(Function<String,GeneratorEntry> generators)
      A filler of a runtime's generators.
      Parameters:
      generators - the generator of a name; throws for an unknown or disabled one
  • Method Details

    • fill

      public void fill(Object entity)
      Description copied from interface: IdFiller
      Fills the @CosId field of entity if it is not set yet; an entity whose class has no such field is left as it is (R1-core-16).
      Specified by:
      fill in interface IdFiller
      Parameters:
      entity - the entity