Class ExpressionEntryData<T>
java.lang.Object
org.skriptlang.skript.lang.entry.EntryData<Expression<? extends T>>
org.skriptlang.skript.lang.entry.KeyValueEntryData<Expression<? extends T>>
org.skriptlang.skript.lang.entry.util.ExpressionEntryData<T>
A type of
KeyValueEntryData
designed to parse its value as an Expression
.
This data CAN return null if expression parsing fails.
Note that it will print an error.-
Constructor Summary
ConstructorDescriptionExpressionEntryData
(String key, @Nullable Expression<T> defaultValue, boolean optional, Class<T> returnType) ExpressionEntryData
(String key, @Nullable Expression<T> defaultValue, boolean optional, Class<T> returnType, int flags) -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable Expression
<? extends T> Parses a String value using this entry data.Methods inherited from class org.skriptlang.skript.lang.entry.KeyValueEntryData
canCreateWith, getSeparator, getValue
Methods inherited from class org.skriptlang.skript.lang.entry.EntryData
getDefaultValue, getKey, isOptional
-
Constructor Details
-
ExpressionEntryData
public ExpressionEntryData(String key, @Nullable @Nullable Expression<T> defaultValue, boolean optional, Class<T> returnType) - Parameters:
returnType
- The expected return type of the matched expression.
-
ExpressionEntryData
public ExpressionEntryData(String key, @Nullable @Nullable Expression<T> defaultValue, boolean optional, Class<T> returnType, int flags) - Parameters:
returnType
- The expected return type of the matched expression.flags
- Parsing flags. SeeSkriptParser(String, int, ParseContext)
javadoc for more details.
-
-
Method Details
-
getValue
Description copied from class:KeyValueEntryData
Parses a String value using this entry data.- Specified by:
getValue
in classKeyValueEntryData<Expression<? extends T>>
- Parameters:
value
- The String value to parse.- Returns:
- The parsed value.
-