Class PropExprValueOf
java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<Object>
org.skriptlang.skript.lang.properties.PropertyBaseExpression<PropertyHandler.TypedValuePropertyHandler<?,?>>
org.skriptlang.skript.common.properties.expressions.PropExprValueOf
- All Implemented Interfaces:
Debuggable
,Expression<Object>
,Loopable<Object>
,Simplifiable<Expression<? extends Object>>
,SyntaxElement
,PropertyBaseSyntax<PropertyHandler.TypedValuePropertyHandler<?,
,?>> RuntimeErrorProducer
,SyntaxRuntimeErrorProducer
@Name("Value")
@Description({"Returns the value of something that has a value, e.g. a node in a config.","The value is automatically converted to the specified type (e.g. text, number) where possible."})
@Example("set {_node} to node \"update check interval\" in the skript config\n\nbroadcast text value of {_node}\n# text value of {_node} = \"12 hours\" (text)\n\nwait for {_node}\'s timespan value\n# timespan value of {_node} = 12 hours (duration)\n")
@Since("2.10")
@RelatedProperty("typed value")
public class PropExprValueOf
extends PropertyBaseExpression<PropertyHandler.TypedValuePropertyHandler<?,?>>
-
Field Summary
Fields inherited from class org.skriptlang.skript.lang.properties.PropertyBaseExpression
expr, properties, property, returnType, returnTypes, useCIP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object @Nullable []
get
(org.bukkit.event.Event event) This is the internal method to get an expression's values.
To get the expression's value from the outside useSimpleExpression.getSingle(Event)
orSimpleExpression.getArray(Event)
.@NotNull Property
<PropertyHandler.TypedValuePropertyHandler<?, ?>> Gets the property this expression represents.boolean
init
(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) Called just after the constructor andSyntaxElement.preInit()
.Methods inherited from class org.skriptlang.skript.lang.properties.PropertyBaseExpression
acceptChange, change, convert, getPropertyReturnTypes, getReturnType, isSingle, possibleReturnTypes, register, toString
Methods inherited from class ch.njol.skript.lang.util.SimpleExpression
check, check, check, getAll, getAnd, getArray, getConvertedExpr, getConvertedExpression, getNode, getSingle, getSource, getTime, isDefault, isLoopOf, iterator, preInit, setTime, setTime, setTime, setTime, setTime, simplify, supportsLoopPeeking, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.njol.skript.lang.Expression
beforeChange, canBeSingle, canReturn, changeInPlace, changeInPlace, getAcceptedChangeModes, getOptionalSingle, getSyntaxTypeName, stream, streamAll
Methods inherited from interface org.skriptlang.skript.lang.properties.PropertyBaseSyntax
getBadTypesErrorMessage, getPropertyName
Methods inherited from interface org.skriptlang.skript.log.runtime.RuntimeErrorProducer
error, error, getRuntimeErrorManager, warning, warning
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser
Methods inherited from interface org.skriptlang.skript.log.runtime.SyntaxRuntimeErrorProducer
getErrorSource
-
Constructor Details
-
PropExprValueOf
public PropExprValueOf()
-
-
Method Details
-
init
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) Description copied from interface:SyntaxElement
Called just after the constructor andSyntaxElement.preInit()
.- Specified by:
init
in interfaceSyntaxElement
- Overrides:
init
in classPropertyBaseExpression<PropertyHandler.TypedValuePropertyHandler<?,
?>> - Parameters:
expressions
- all %expr%s included in the matching pattern in the order they appear in the pattern. If an optional value was left out, it will still be included in this list holding the default value of the desired type, which usually depends on the event.matchedPattern
- The index of the pattern which matchedisDelayed
- Whether this expression is used after a delay or not (i.e. if the event has already passed when this expression will be called)parseResult
- Additional information about the match.- Returns:
- Whether this expression was initialised successfully. An error should be printed prior to returning false to specify the cause.
- See Also:
-
get
Description copied from class:SimpleExpression
This is the internal method to get an expression's values.
To get the expression's value from the outside useSimpleExpression.getSingle(Event)
orSimpleExpression.getArray(Event)
.- Overrides:
get
in classPropertyBaseExpression<PropertyHandler.TypedValuePropertyHandler<?,
?>> - Parameters:
event
- The event with which this expression is evaluated.- Returns:
- An array of values for this event. May not contain nulls.
-
getProperty
Description copied from interface:PropertyBaseSyntax
Gets the property this expression represents. This is used to find the appropriate handlers for the expression's input types.- Returns:
- The property this expression represents.
-