Module it.rebirthproject.ufoeb
Class CompleteEventInheritancePolicy
java.lang.Object
it.rebirthproject.ufoeb.eventinheritancepolicy.policies.CompleteEventInheritancePolicy
- All Implemented Interfaces:
InheritancePolicy
This implementation of the
InheritancePolicy
interface searches for
all superclasses and interfaces given the event class. With this policy the
resulting eventSuperClassesAndInterfacesCache set will contain the given
class, all its extended superclasses and all its implemented interfaces
(recursively).-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAllEventInheritanceObjects
(Object eventObjectToPost, EventsRegistrationsMap eventsRegistrations, Map<Class<?>, Set<Class<?>>> eventSuperClassesAndInterfacesCache) The interface method that returns a set of classes (the implementation usesLinkedHashSet
to preserve order of insertion), based on the chosen inheritance policy.serializeEventStructure
(Class<?> eventClass, EventsRegistrationsMap eventsRegistrations) This method will find all superclasses and interfaces given the event class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.rebirthproject.ufoeb.eventinheritancepolicy.base.InheritancePolicy
addClassOrInterfaceToSerializationIfNecessary, serializeInterfaces
-
Constructor Details
-
CompleteEventInheritancePolicy
public CompleteEventInheritancePolicy()
-
-
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 usesLinkedHashSet
to preserve order of insertion), based on the chosen inheritance policy.- Specified by:
getAllEventInheritanceObjects
in interfaceInheritancePolicy
- Parameters:
eventObjectToPost
- The event object to post.eventsRegistrations
- The complete map of events'Registration
s.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 and interfaces given the event class. The resulting set will contain the given class, all its extended superclasses and all its implemented interfaces (recursively).- Parameters:
eventClass
- The class to serialize (we want to find all superclasses).eventsRegistrations
- The event registration map.- Returns:
- The complete set of classes.
-