Class ClassEventInheritancePolicy

java.lang.Object
it.rebirthproject.ufoeb.eventinheritancepolicy.policies.ClassEventInheritancePolicy
All Implemented Interfaces:
InheritancePolicy

public class ClassEventInheritancePolicy extends Object implements InheritancePolicy
This implementation of the InheritancePolicy interface searches for all superclasses (and only them) given the event class. With this policy the resulting eventSuperClassesAndInterfacesCache set will contain the given class and all its extended superclasses (recursively).
  • Constructor Details

    • ClassEventInheritancePolicy

      public ClassEventInheritancePolicy()
  • Method Details

    • getAllEventInheritanceObjects

      public Set<Class<?>> getAllEventInheritanceObjects(Object eventObjectToPost, EventsRegistrationsMap eventsRegistrations, Map<Class<?>,Set<Class<?>>> eventSuperClassesAndInterfacesCache)
      Description copied from interface: InheritancePolicy
      The interface method that returns a set of classes (the implementation uses LinkedHashSet to preserve order of insertion), based on the chosen inheritance policy.
      Specified by:
      getAllEventInheritanceObjects in interface InheritancePolicy
      Parameters:
      eventObjectToPost - The event object to post.
      eventsRegistrations - The complete map of events' Registrations.
      eventSuperClassesAndInterfacesCache - The cache used to save event class/superclasses/interfaces serialization.
      Returns:
      a set of classes based on the chosen inheritance policy.
    • serializeEventStructure

      private Set<Class<?>> serializeEventStructure(Class<?> eventClass, EventsRegistrationsMap eventsRegistrations)
      This method will find all superclasses given the event class. The resulting set will contain the event class itself and all its extended superclasses (recursively).
      Parameters:
      eventClass - The class to serialize (we want to find all superclasses).
      eventsRegistrations - The event registration map.
      Returns:
      The complete set of classes.