Package ch.njol.skript.lang
Interface DefaultExpression<T>
- All Superinterfaces:
Debuggable
,Expression<T>
,SyntaxElement
- All Known Implementing Classes:
SimpleLiteral
Represents an expression that can be used as the default value of a certain type or event.
-
Method Summary
Methods inherited from interface ch.njol.skript.lang.Debuggable
toString, toString
Methods inherited from interface ch.njol.skript.lang.Expression
acceptChange, beforeChange, canBeSingle, canReturn, change, changeInPlace, changeInPlace, check, check, getAcceptedChangeModes, getAll, getAnd, getArray, getConvertedExpression, getOptionalSingle, getReturnType, getSingle, getSource, getTime, isLoopOf, isSingle, iterator, possibleReturnTypes, setTime, simplify, stream
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, init
-
Method Details
-
init
boolean init()Called when an expression is initialized.- Returns:
- Whether the expression is valid in its context. Skript will error if false.
-
isDefault
boolean isDefault()Description copied from interface:Expression
Returns whether this value represents the default value of its type for the event, i.e. it can be replaced with a call to event.getXyz() if one knows the event invalid input: '&' value type.This method might be removed in the future as it's better to check whether value == event.getXyz() for every value an expression returns.
- Specified by:
isDefault
in interfaceExpression<T>
- Returns:
- Usually true, though this is not required, as e.g. SimpleLiteral implements DefaultExpression but is usually not the default of an event.
-