Class ContextValue<C extends TriggerContext, T>
java.lang.Object
io.github.syst3ms.skriptparser.registration.context.ContextValue<C,T>
A class containing info about a context value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum to indicate the relative position in time between two similar context values.static enumOne can use context values in two different ways:context-something- the value is used with the common prefix 'context'; orsomething- the value is used alone as an expression. The usage determines which of the two variants, or both, are applicable. -
Constructor Summary
ConstructorsConstructorDescriptionContextValue(Class<C> context, Type<T> returnType, boolean isSingle, PatternElement pattern, Function<C, T[]> function, ContextValue.State state, ContextValue.Usage usage) ContextValue(Class<C> context, Type<T> returnType, boolean isSingle, PatternElement pattern, Function<C, T[]> function, ContextValue.State state, ContextValue.Usage usage, Class<? extends C>[] excluded) -
Method Summary
Modifier and TypeMethodDescriptionSome subclasses don't want to inherit the context values of their parents.Returns the function that will be applied onto the context in order to retrieve the correct value.Returns the pattern of this context value.getState()A contextual expression mostly refers to things that happen because of the event, but, sometimes, an event can have a former and future aspect.getUsage()
-
Constructor Details
-
ContextValue
public ContextValue(Class<C> context, Type<T> returnType, boolean isSingle, PatternElement pattern, Function<C, T[]> function, ContextValue.State state, ContextValue.Usage usage) -
ContextValue
public ContextValue(Class<C> context, Type<T> returnType, boolean isSingle, PatternElement pattern, Function<C, T[]> function, ContextValue.State state, ContextValue.Usage usage, Class<? extends C>[] excluded)
-
-
Method Details
-
getContext
-
getReturnType
-
getPattern
-
getFunction
-
getState
A contextual expression mostly refers to things that happen because of the event, but, sometimes, an event can have a former and future aspect. The state of the context value describes these aspects.- Returns:
- whether this happens in the past, present or future
-
getUsage
- Returns:
- whether this value can be used alone
-
getExcluded
-