public interface PlaceholderContext
PlaceholderParser
can use to determine
what to display.Modifier and Type | Interface and Description |
---|---|
static interface |
PlaceholderContext.Builder
A builder for
PlaceholderText objects. |
Modifier and Type | Method and Description |
---|---|
static PlaceholderContext.Builder |
builder()
Creates a
PlaceholderContext for a PlaceholderParser to
consume. |
Optional<String> |
getArgumentString()
The variable string passed to this token to provide contextual
information.
|
Optional<Object> |
getAssociatedObject()
If provided, the
Object which to pull information from
when building the placeholder text. |
static PlaceholderContext.Builder builder()
PlaceholderContext
for a PlaceholderParser
to
consume.Optional<Object> getAssociatedObject()
Object
which to pull information from
when building the placeholder text.
Examples of how this might affect a placeholder are:
It is important to note that the associated context does not
necessarily have to be the sender/invoker of a message, nor does it
have to be the recipient. The source is selected by the context of
builder. It is up to plugins that use such placeholders to be aware
of the context of which the placeholder is used.
PlaceholderParser
s should make no assumption about the origin of
the context.
If an invalid Object
is provided for the context
of the placeholder, then the associated PlaceholderParser
must
return a Text.EMPTY
.
Object
, if any.