java.lang.Object
io.cloudevents.core.provider.EventFormatProvider
Singleton holding the discovered
EventFormat implementations through
ServiceLoader.
You can resolve an event format using
EventFormatProvider.getInstance().resolveFormat(contentType).
You can programmatically add a new EventFormat implementation using
registerFormat(EventFormat).
-
Method Summary
Modifier and TypeMethodDescriptionEnumerate the supported content types.static EventFormatProvidervoidregisterFormat(EventFormat format) Register a newEventFormatprogrammatically.resolveFormat(ContentType contentType) Resolve an event format starting from the content type.resolveFormat(String contentType) Resolve an event format starting from the content type.
-
Method Details
-
getInstance
- Returns:
- instance of
EventFormatProvider
-
registerFormat
Register a newEventFormatprogrammatically.- Parameters:
format- the new format to register
-
getContentTypes
Enumerate the supported content types.- Returns:
- an alphabetically sorted list of content types
-
resolveFormat
Resolve an event format starting from the content type.- Parameters:
contentType- the content type to resolve the event format- Returns:
- null if no format was found for the provided content type
-
resolveFormat
Resolve an event format starting from the content type.- Parameters:
contentType- the content type to resolve the event format- Returns:
- null if no format was found for the provided content type
-