Interface SyntaxInfo<E extends SyntaxElement>
- Type Parameters:
E
- The class providing the implementation of the syntax this info represents.
- All Superinterfaces:
Builder.Buildable<SyntaxInfo.Builder<?,
,?>, SyntaxInfo<?>> DefaultSyntaxInfos
- All Known Subinterfaces:
BukkitSyntaxInfos.Event<E>
,DefaultSyntaxInfos.Expression<E,
,R> DefaultSyntaxInfos.Structure<E>
- All Known Implementing Classes:
SkriptEventInfo.ModernSkriptEventInfo
@Experimental
public interface SyntaxInfo<E extends SyntaxElement>
extends Builder.Buildable<SyntaxInfo.Builder<?,?>,SyntaxInfo<?>>, DefaultSyntaxInfos
A syntax info contains the details of a syntax, including its origin and patterns.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
SyntaxInfo.Builder<B extends SyntaxInfo.Builder<B,
E>, E extends SyntaxElement> A builder is used for constructing a new syntax info.Nested classes/interfaces inherited from interface org.skriptlang.skript.registration.DefaultSyntaxInfos
DefaultSyntaxInfos.Expression<E extends Expression<R>,
R>, DefaultSyntaxInfos.Structure<E extends Structure> -
Field Summary
Modifier and TypeFieldDescriptionstatic final Priority
A priority for infos with patterns that contain at least oneDefaultSyntaxInfos.Expression
.static final Priority
A priority for infos with patterns that can match almost anything.static final Priority
A priority for infos with patterns that only match simple text (they do not have anyDefaultSyntaxInfos.Expression
s). -
Method Summary
Modifier and TypeMethodDescriptionSyntaxInfo.Builder
<? extends SyntaxInfo.Builder<?, E>, E> builder()
static <E extends SyntaxElement>
SyntaxInfo.Builder<? extends SyntaxInfo.Builder<?, E>, E> Constructs a builder for a syntax info.instance()
origin()
@Unmodifiable Collection
<String> patterns()
priority()
type()
-
Field Details
-
SIMPLE
A priority for infos with patterns that only match simple text (they do not have anyDefaultSyntaxInfos.Expression
s). Example: "[the] console" -
COMBINED
A priority for infos with patterns that contain at least oneDefaultSyntaxInfos.Expression
. This is typically the default priority of an info. Example: "[the] first %number% characters of %strings%" -
PATTERN_MATCHES_EVERYTHING
A priority for infos with patterns that can match almost anything. This is likely the case when using regex or multiple expressions next to each other in a pattern. Example: "[the] [loop-]invalid input: '<'.+>"
-
-
Method Details
-
builder
@Contract("_ -> new") static <E extends SyntaxElement> SyntaxInfo.Builder<? extends SyntaxInfo.Builder<?,E>, builderE> (Class<E> type) Constructs a builder for a syntax info.- Parameters:
type
- The syntax class the info will represent.- Returns:
- A builder for creating a syntax info representing
type
.
-
builder
- Specified by:
builder
in interfaceBuilder.Buildable<SyntaxInfo.Builder<?,
?>, SyntaxInfo<?>> - Returns:
- A builder representing this object.
-
origin
SyntaxOrigin origin()- Returns:
- The origin of this syntax.
-
type
- Returns:
- The class providing the implementation of this syntax.
-
instance
- Returns:
- A new instance of the class providing the implementation of this syntax.
-
patterns
@Unmodifiable Collection<String> patterns()- Returns:
- The patterns of this syntax.
-
priority
Priority priority()- Returns:
- The priority of this syntax, which dictates its position for matching during parsing.
-