public class MultiSubstitution extends java.lang.Object implements Template
This will call the same sub-template multiple times, with a different inner value provider, but with the same parent provider. Thus, all known tags from the incoming provider are still resolvable.
| Constructor and Description |
|---|
MultiSubstitution(java.lang.String tag,
Template subTemplate,
Dict<MultiDecoration,Template> deco) |
MultiSubstitution(java.lang.String tag,
Template subTemplate,
java.lang.Iterable<Tuple2<MultiDecoration,Template>> deco) |
MultiSubstitution(java.lang.String tag,
Template subTemplate,
java.util.Map<MultiDecoration,Template> deco) |
MultiSubstitution(java.lang.String tag,
Template subTemplate,
Template separatorTemplate) |
MultiSubstitution(java.lang.String tag,
Template subTemplate,
Template prefixTemplate,
Template separatorTemplate,
Template suffixTemplate)
Constructor.
|
MultiSubstitution(java.lang.String tag,
Template subTemplate,
Tuple2<MultiDecoration,Template>... deco) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(java.lang.StringBuilder collector,
ValueProvider valueProvider)
Append the resolved template to the given collector.
|
void |
check(ValueProvider valueProvider,
FStack<TagReference> insertionStack,
java.util.function.Consumer<FStack<TagReference>> resolvedTagHandler,
java.util.function.Consumer<FStack<TagReference>> unresolvedTagHandler)
Run a check with the given value provider.
|
Template |
getPrefixTemplate()
Get the prefix template.
|
Template |
getSeparatorTemplate()
Get the separator template.
|
Template |
getSubTemplate()
Get the multiple inserted sub-template.
|
Template |
getSuffixTemplate()
Get the suffix template.
|
java.lang.String |
getTag()
Get the tag for the multiple value provider.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcollectUnresolvedTags, resolvepublic MultiSubstitution(@NotNull java.lang.String tag, @NotNull Template subTemplate, @NotNull Template prefixTemplate, @NotNull Template separatorTemplate, @NotNull Template suffixTemplate)
tag - tag key for the multiple value iterablesubTemplate - sub-template called multiple timespublic MultiSubstitution(@NotNull java.lang.String tag, @NotNull Template subTemplate, @NotNull java.lang.Iterable<Tuple2<MultiDecoration,Template>> deco)
@SafeVarargs public MultiSubstitution(@NotNull java.lang.String tag, @NotNull Template subTemplate, @NotNull Tuple2<MultiDecoration,Template>... deco)
public MultiSubstitution(@NotNull java.lang.String tag, @NotNull Template subTemplate, @NotNull Template separatorTemplate)
public MultiSubstitution(@NotNull java.lang.String tag, @NotNull Template subTemplate, @NotNull Dict<MultiDecoration,Template> deco)
@NotNull public java.lang.String getTag()
@NotNull public Template getSubTemplate()
@NotNull public Template getPrefixTemplate()
The prefix template is inserted before the repeated multiple insertion if there is at least one insertion.
@NotNull public Template getSeparatorTemplate()
The separator template is inserted between repeated multiple insertions if there are at least two insertions.
@NotNull public Template getSuffixTemplate()
The suffix template is inserted after the repeated multiple insertion if there is at least one insertion.
public void appendTo(@NotNull java.lang.StringBuilder collector, @NotNull ValueProvider valueProvider)
Templatepublic void check(@NotNull ValueProvider valueProvider, @NotNull FStack<TagReference> insertionStack, @NotNull java.util.function.Consumer<FStack<TagReference>> resolvedTagHandler, @NotNull java.util.function.Consumer<FStack<TagReference>> unresolvedTagHandler)
TemplateInstead of throwing after the first problem this method is expected to check as much as possible.
check in interface TemplatevalueProvider - value provider checked against this templateinsertionStack - stack of multiple insertions before the level of this check is reachedresolvedTagHandler - collector for successfully resolved template tagsunresolvedTagHandler - collector for unresolvable template tags, if multiple tags fail to be resolved
tags in lower levels cannot be checkedpublic java.lang.String toString()
toString in class java.lang.Object