Package de.espirit.firstspirit.agency
Interface SnippetAgent
public interface SnippetAgent
Agent providing access to stored element snippet information.
- Since:
- 5.2.180704
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Fallback configuration object definition. -
Field Summary
Modifier and TypeFieldDescriptionstatic final SpecialistType<SnippetAgent>
Agent providing image containers. -
Method Summary
Modifier and TypeMethodDescription@NotNull SnippetAgent.Fallback
fallback()
Creates a new fallback configuration object with its default strategies in place.@NotNull SnippetProvider
getSnippetProvider
(@NotNull IDProvider element) Hands out a snippet provider for the given element ornull
, if no snippet provider is available.@NotNull SnippetProvider
getSnippetProvider
(@NotNull IDProvider element, @NotNull SnippetAgent.Fallback fallback) Hands out a snippet provider for the given element applying the given fallback strategy.@NotNull SnippetProvider
getSnippetProvider
(@NotNull FormData formData, @NotNull Snippet snippet) Serves a snippet provider based on the given snippet and form data.@NotNull SnippetProvider
getSnippetProvider
(@NotNull FormData formData, @NotNull Snippet snippet, @NotNull SnippetContext context) Serves a snippet provider based on the given snippet and form data.@Nullable Image<?>
getTypeIcon
(@NotNull IDProvider element) Provides a type image resource for the given element.
-
Field Details
-
TYPE
Agent providing image containers.- Since:
- 5.2.180704
-
-
Method Details
-
getTypeIcon
Provides a type image resource for the given element. Maybenull
, if no type image is available.- Parameters:
element
- The element that is to be rendered in report lists.- Returns:
- An image or
null
if no image is to be shown. - Since:
- 5.2.180704
-
getSnippetProvider
Hands out a snippet provider for the given element ornull
, if no snippet provider is available. This is a convenience method forgetSnippetProvider(IDProvider, Fallback)
with default fallback configuration.- Parameters:
element
- The element to provide for.- Returns:
- A snippet provider or
null
. - Since:
- 5.2.180704
-
getSnippetProvider
@NotNull @NotNull SnippetProvider getSnippetProvider(@NotNull @NotNull IDProvider element, @NotNull @NotNull SnippetAgent.Fallback fallback) Hands out a snippet provider for the given element applying the given fallback strategy.- Parameters:
element
- The element to provide for.fallback
- The fallback configuration.- Returns:
- A snippet provider.
- Since:
- 5.2.180704
-
getSnippetProvider
@NotNull @NotNull SnippetProvider getSnippetProvider(@NotNull @NotNull FormData formData, @NotNull @NotNull Snippet snippet) Serves a snippet provider based on the given snippet and form data. Delegates togetSnippetProvider(FormData, Snippet, SnippetContext)
employing thesnippet context
with its defined default values.- Parameters:
formData
- The form data to base snippets on.snippet
- The snippet definition.- Returns:
- A snippet provider.
- Since:
- 5.2.201206
-
getSnippetProvider
@NotNull @NotNull SnippetProvider getSnippetProvider(@NotNull @NotNull FormData formData, @NotNull @NotNull Snippet snippet, @NotNull @NotNull SnippetContext context) Serves a snippet provider based on the given snippet and form data. Takes a mandatory snippet context to enable adding contextual information for the evaluation.- Parameters:
formData
- The form data to base snippets on.snippet
- The snippet definition.context
- A snippet context provider- Returns:
- A snippet provider.
- Since:
- 5.2.201206
-
fallback
Creates a new fallback configuration object with its default strategies in place.- Returns:
- A fallback configuration object.
- Since:
- 5.2.180704
-