Class PlaceholderEngine
java.lang.Object
ml.karmaconfigs.api.common.utils.placeholder.util.PlaceholderEngine
- Direct Known Subclasses:
GlobalPlaceholderEngine
Karma placeholder engine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <T> voidforceRegister(Placeholder<T>... placeholders)Force placeholder registrationsabstract Set<Placeholder<?>>getKeys()Get all the placeholders registered to this engineabstract <T> @Nullable Placeholder<T>getPlaceholder(String key)Get a placeholderabstract String[]Parse a messageabstract StringParse a messageParse a messageabstract voidprotect()Protect the placeholder engine against already added placeholder modificationsabstract <T> voidregister(Placeholder<T>... placeholders)Register more placeholdersabstract voidregisterUnsafe(Placeholder<?>... placeholders)Register placeholders indiscriminatelyabstract voidsetCloseIdentifier(char identifier)Set the placeholder close identifierabstract voidsetOpenIdentifier(char identifier)Set the placeholder open identifiertoString()Returns a string representation of the object.abstract voidunregister(String... placeholders)Unregister placeholdersabstract <T> voidunregister(Placeholder<T>... placeholders)Unregister placeholders
-
Constructor Details
-
PlaceholderEngine
public PlaceholderEngine()
-
-
Method Details
-
setOpenIdentifier
public abstract void setOpenIdentifier(char identifier)Set the placeholder open identifier- Parameters:
identifier- the placeholder identifier character
-
setCloseIdentifier
public abstract void setCloseIdentifier(char identifier)Set the placeholder close identifier- Parameters:
identifier- the placeholder identifier character
-
protect
public abstract void protect()Protect the placeholder engine against already added placeholder modifications -
register
Register more placeholders- Type Parameters:
T- the placeholder type- Parameters:
placeholders- the placeholders to register
-
registerUnsafe
Register placeholders indiscriminately- Parameters:
placeholders- the placeholders to register
-
forceRegister
Force placeholder registrations- Type Parameters:
T- the placeholder type- Parameters:
placeholders- the placeholders to register
-
unregister
Unregister placeholders- Parameters:
placeholders- the placeholders to unregister
-
unregister
Unregister placeholders- Type Parameters:
T- the placeholder type- Parameters:
placeholders- the placeholders to unregister
-
getPlaceholder
Get a placeholder- Type Parameters:
T- the placeholder type- Parameters:
key- the placeholder identifier- Returns:
- the placeholder
-
parse
Parse a message- Parameters:
message- the messagecontainers- the placeholder containers- Returns:
- the parsed message
-
parse
Parse a message- Parameters:
message- the messagecontainers- the placeholder containers- Returns:
- the parsed message
-
parse
Parse a message- Parameters:
message- the messagecontainers- the placeholder containers- Returns:
- the parsed message
-
getKeys
Get all the placeholders registered to this engine- Returns:
- the placeholder keys
-
toString
Returns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The
toStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
-