Class ExprSingleParameter
java.lang.Object
io.github.syst3ms.skriptparser.lang.lambda.SectionValue<ArgumentSection, Object>
io.github.syst3ms.skriptparser.expressions.ExprSingleParameter
- All Implemented Interfaces:
Expression<Object>, SyntaxElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends ArgumentSection> Object[]getSectionValues(ArgumentSection section, TriggerContext ctx) Returns the values of thisSectionValue, akin to the output ofExpression.getValues(TriggerContext), given the linked section and theTriggerContext.booleanpreInitialize(Expression<?>[] expressions, int matchedPattern, ParseContext parseContext) This method is run before the section linked to thisSectionValueis identified, and should be used to initialize fields and other class data using the usual parameters of theSyntaxElement.init(Expression[], int, ParseContext)function.toString(TriggerContext ctx, boolean debug) Methods inherited from class SectionValue
getSelectorFunction, getValues, init, postInitializeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Expression
acceptsChange, acceptsChange, acceptsChange, change, check, check, convertExpression, getArray, getReturnType, getSingle, getSource, isAndList, isLoopOf, isSingle, iterator, setAndList, stream
-
Constructor Details
-
ExprSingleParameter
public ExprSingleParameter()
-
-
Method Details
-
preInitialize
public boolean preInitialize(Expression<?>[] expressions, int matchedPattern, ParseContext parseContext) Description copied from class:SectionValueThis method is run before the section linked to thisSectionValueis identified, and should be used to initialize fields and other class data using the usual parameters of theSyntaxElement.init(Expression[], int, ParseContext)function.- Specified by:
preInitializein classSectionValue<ArgumentSection, Object>- Parameters:
expressions- an array of expressions representing all the expressions that are being passed to thisSectionValue. As opposed to Skript, elements of this array can't benull.matchedPattern- the index of the pattern that was successfully matched. It corresponds to the order of the syntaxes in registrationparseContext- an object containing additional information about the parsing of thisSectionValue, like regex matches and parse marks- Returns:
trueif theSectionValuewas pre-initialized successfully,falseotherwise.- See Also:
-
getSectionValues
Description copied from class:SectionValueReturns the values of thisSectionValue, akin to the output ofExpression.getValues(TriggerContext), given the linked section and theTriggerContext.- Specified by:
getSectionValuesin classSectionValue<ArgumentSection, Object>- Parameters:
section- the linked sectionctx- theTriggerContext- Returns:
- the values of this
SectionValue
-
getSectionClass
- Specified by:
getSectionClassin classSectionValue<ArgumentSection, Object>- Returns:
- the class of the
ArgumentSectionthisSectionValueis linked to.
-
toString
- Parameters:
ctx- the eventdebug- whether to show additional information or not- Returns:
- a
Stringthat should aim to resemble what is written in the script as closely as possible
-