Class PlaceholderResolver
java.lang.Object
io.github.kaktushose.jdac.message.placeholder.PlaceholderResolver
The placeholder resolver is used to do simple placeholder/variable resolution. JDA-Commands uses a format similar to project fluent but with some restrictions.
The overall placeholder format is { $your_placeholder }, with following properties:
- the leading
$is optional - whitespace, newlines,
{and$are forbidden inside the reference name - trailing and leading whitespace or newline of the reference name is trimmed (see
String.trim()). - to escape the
{character just prefix it with\\(backslashes can be used unescaped in the rest of the string)
Invalid placeholders will just be treated as literal text.
To get a variables string representation, this resolver:
- calls
Proteus.convert(Object, Type, Type)trying to convert the values toType.of(String.class) - if not successful, just calls
Object.toString()
If a variable couldn't be found, null will be inserted.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PlaceholderResolver
public PlaceholderResolver()
-
-
Method Details
-
resolve
-