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.
  • Field Details

    • SIMPLE

      static final Priority SIMPLE
      A priority for infos with patterns that only match simple text (they do not have any DefaultSyntaxInfos.Expressions). Example: "[the] console"
    • COMBINED

      static final Priority COMBINED
      A priority for infos with patterns that contain at least one DefaultSyntaxInfos.Expression. This is typically the default priority of an info. Example: "[the] first %number% characters of %strings%"
    • PATTERN_MATCHES_EVERYTHING

      static final Priority 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>,E> builder(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

      @Contract("-> new") SyntaxInfo.Builder<? extends SyntaxInfo.Builder<?,E>,E> builder()
      Specified by:
      builder in interface Builder.Buildable<SyntaxInfo.Builder<?,?>,SyntaxInfo<?>>
      Returns:
      A builder representing this object.
    • origin

      SyntaxOrigin origin()
      Returns:
      The origin of this syntax.
    • type

      Class<E> type()
      Returns:
      The class providing the implementation of this syntax.
    • instance

      @Contract("-> new") E 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.