Package org.kingdoms.locale.compiler
Class MessageObject
java.lang.Object
org.kingdoms.locale.compiler.MessageObject
- All Implemented Interfaces:
MessageObjectBuilder
- Direct Known Subclasses:
CombinedMessageObject,ContextualMessageObject
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild(ComplexMessageBuilderContextProvider contextProvider) voidbuild(HTMLMessageBuilderContextProvider contextProvider) voidbuild(PlainMessageBuilderContextProvider contextProvider) static MessageObjectcombine(MessageObject... objects) intcount(Predicate<MessagePiece> filter) evaluateDynamicPieces(MessagePlaceholderProvider placeholderContextProvider) Gives a pure MessageObject that doesn't require a placeholder provider anymore.filter(Predicate<MessagePiece> filter) findColorPieces(int colorIndex, boolean backwards) static MessageObjectfrom(Boolean usePrefix, MessagePiece... pieces) static MessageObjectfrom(MessagePiece... pieces) booleanhasPiece(Predicate<MessagePiece> filter) booleanisAvailable(MessagePlaceholderProvider builder) Whether any of this message object's methods can be used.booleanisNull()Mostly happens when a line is only condition based and the condition isn't matched, so the entire line is omitted.merge(boolean after, MessagePiece... others) merge(MessageObject... others) static MessagePiece[]mergeObjectToPieces(MessageObject... objects) <I extends MessagePiece,O extends MessagePiece>
MessageObjectreplace(Predicate<MessagePiece> filter, Function<I, O> replacement) splitBy(boolean preservePiece, Predicate<MessagePiece> predicate) Splits this message object to multiple lines (if new line character is available) and makes each line inherit the color of its previous line.toString()validateAll(Predicate<MessagePiece> validator) withContext(MessagePlaceholderProvider context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kingdoms.locale.compiler.builders.MessageObjectBuilder
buildComplex, buildPlain
-
Field Details
-
NULL
-
pieces
-
-
Constructor Details
-
MessageObject
-
-
Method Details
-
from
-
from
-
validateAll
-
getPieces
-
getUsePrefix
-
isNull
public boolean isNull()Mostly happens when a line is only condition based and the condition isn't matched, so the entire line is omitted. -
splitBy
-
hasPiece
-
count
-
combine
-
withContext
-
mergeObjectToPieces
-
merge
-
merge
-
filter
-
findLastColors
-
splitLines
Splits this message object to multiple lines (if new line character is available) and makes each line inherit the color of its previous line. -
replace
public <I extends MessagePiece,O extends MessagePiece> MessageObject replace(Predicate<MessagePiece> filter, Function<I, O> replacement) -
findColorPieces
-
build
- Specified by:
buildin interfaceMessageObjectBuilder
-
build
- Specified by:
buildin interfaceMessageObjectBuilder
-
build
- Specified by:
buildin interfaceMessageObjectBuilder
-
isAvailable
Description copied from interface:MessageObjectBuilderWhether any of this message object's methods can be used.- Specified by:
isAvailablein interfaceMessageObjectBuilder
-
evaluateDynamicPieces
Gives a pure MessageObject that doesn't require a placeholder provider anymore. All message pieces that require placeholders/context are evaluated and turned into constant message pieces.- Specified by:
evaluateDynamicPiecesin interfaceMessageObjectBuilder
-
getSimpleProvider
-
getExtraProvider
-
toString
-