Class PlaceholderContextBuilder
java.lang.Object
org.kingdoms.locale.compiler.placeholders.PlaceholderContextBuilder
- All Implemented Interfaces:
Cloneable,PlaceholderContextProvider
- Direct Known Subclasses:
MessageBuilder
public class PlaceholderContextBuilder
extends Object
implements PlaceholderContextProvider, Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,PlaceholderContextProvider> Should be used for placeholder targets for future updates.protected ObjectCan be either: PlaceholderTranslationContext MessageObjectBuilder any other object counts as a raw placeholderprotected Objectprotected PlaceholderContextProviderFields inherited from interface org.kingdoms.locale.compiler.placeholders.PlaceholderContextProvider
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllIfAbsent(Map<String, Object> placeholders) voidaddChild(String id, PlaceholderContextProvider provider) booleanclone()ensurePlaceholdersCapacity(int amount) getMain()getPlaceholder(String str) booleanimpregnate(int capacity) inheritContext(PlaceholderContextBuilder other, boolean replace) onUnknownPlaceholder(PlaceholderContextProvider unknownPlaceholderHandler) other(org.bukkit.entity.Player other) placeholders(Object... edits) processPlaceholder(String placeholder) voidsetChildren(Map<String, PlaceholderContextProvider> children) voidvoidsetRelationalSecond(Object relationalSecond) voidtoString()protected PlaceholderContextBuilderwithContext(org.bukkit.command.CommandSender sender) withContext(org.bukkit.entity.Player player) withContext(org.bukkit.OfflinePlayer player) withContext(Group group) withContext(Kingdom kingdom) withContext(Nation nation)
-
Field Details
-
placeholders
Can be either: PlaceholderTranslationContext MessageObjectBuilder any other object counts as a raw placeholder -
children
Should be used for placeholder targets for future updates. %target*placeholder% e.g. %third_kingdom*kingdoms_kingdom_name%But how does one compare the relations between multiple targets? Maybe a second op? %target**placeholder% would put the "target"'s main context into relationalSecond of the current context.
-
unknownPlaceholderHandler
-
main
-
relationalSecond
-
-
Constructor Details
-
PlaceholderContextBuilder
public PlaceholderContextBuilder()
-
-
Method Details
-
processPlaceholder
- Specified by:
processPlaceholderin interfacePlaceholderContextProvider
-
setMain
-
getMain
-
setRelationalSecond
-
getRelationalSecond
-
switchContext
public void switchContext() -
clone
-
cloneInto
-
canHandleRelational
public boolean canHandleRelational() -
setChildren
-
getChildren
-
impregnate
-
addChild
-
inheritPlaceholders
-
inheritContext
-
addAll
-
addAllIfAbsent
-
raws
-
placeholders
-
variables
-
getPlaceholders
-
withContext
-
hasContext
public boolean hasContext() -
withContext
-
withContext
-
withContext
-
withContext
-
withContext
-
getUnknownPlaceholderHandler
-
onUnknownPlaceholder
public PlaceholderContextProvider onUnknownPlaceholder(PlaceholderContextProvider unknownPlaceholderHandler) -
other
-
other
-
other
-
other
-
ensurePlaceholdersCapacity
-
resetPlaceholders
-
parse
-
raw
-
getPlaceholder
-
toString
-