public class EventTypeResolver extends Object
Look up event types. This class looks for META-INF/lenskit/event-builders.properties
files in the classpath and looks up event type names in them.
Modifier and Type | Method and Description |
---|---|
static EventTypeResolver |
create()
Create a new event type resolver for the current class loader.
|
static EventTypeResolver |
create(ClassLoader loader)
Create a new event type resolver for a class loader.
|
Class<? extends EventBuilder> |
getEventBuilder(Class<? extends Event> eventType) |
Class<? extends EventBuilder> |
getEventBuilder(String name)
Get an event builder for the specified type name.
|
public static EventTypeResolver create(ClassLoader loader)
Create a new event type resolver for a class loader.
loader
- The class loader.public static EventTypeResolver create()
Create a new event type resolver for the current class loader.
ClassLoaders.inferDefault()
@Nullable public Class<? extends EventBuilder> getEventBuilder(String name)
Get an event builder for the specified type name. It first looks up the type name using the properties files loaded from the classpath, then tries to instantiate it as a class.
name
- The type name.@Nullable public Class<? extends EventBuilder> getEventBuilder(Class<? extends Event> eventType)