Package ch.njol.skript.lang
Interface InputSource
public interface InputSource
An InputSource represents a syntax that can provide a
value for
ExprInput
to use.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
-
Method Summary
Modifier and TypeMethodDescriptiondefault @UnknownNullability String
This should only be used byInputSource
s that return true forhasIndices()
.@Nullable Object
Set
<ch.njol.skript.expressions.ExprInput<?>> default boolean
InputSource
s that can supply indices along with values should override this method to indicate their ability.default @Nullable Expression
<?> parseExpression
(String expr, ParserInstance parser, int flags) Parses an expression using the given input source and parser instance.
-
Method Details
-
getDependentInputs
Set<ch.njol.skript.expressions.ExprInput<?>> getDependentInputs()- Returns:
- A mutable
Set
ofExprInput
s that depend on this source.
-
getCurrentValue
- Returns:
- The current value that
ExprInput
should use.
-
hasIndices
default boolean hasIndices()InputSource
s that can supply indices along with values should override this method to indicate their ability.- Returns:
- Whether this source can return indices.
-
getCurrentIndex
This should only be used byInputSource
s that return true forhasIndices()
.- Returns:
- The current value's index.
-
parseExpression
@Nullable default @Nullable Expression<?> parseExpression(String expr, ParserInstance parser, int flags) Parses an expression using the given input source and parser instance.- Parameters:
expr
- the string expression to be parsed.parser
- the parser instance used for parsing the expression.- Returns:
- the parsed expression, or null if the parsing fails.
-