Class PatternElement

java.lang.Object
ch.njol.skript.patterns.PatternElement
Direct Known Subclasses:
ChoicePatternElement, GroupPatternElement, LiteralPatternElement, OptionalPatternElement, ParseTagPatternElement, RegexPatternElement, TypePatternElement

public abstract class PatternElement extends Object
A pattern element represents a part of a SkriptPattern.
  • Constructor Details

    • PatternElement

      public PatternElement()
  • Method Details

    • match

      @Nullable public abstract @Nullable MatchResult match(String expr, MatchResult matchResult)
    • matchNext

      @Nullable protected @Nullable MatchResult matchNext(String expr, MatchResult matchResult)
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
    • toString

      public abstract String toString(SkriptPattern.StringificationProperties properties)
      Constructs a string representation of this pattern element.
      Parameters:
      properties - Properties to consider during stringification.
      Returns:
      A string representation of this pattern element.
    • toFullString

      @Deprecated(since="2.15", forRemoval=true) public String toFullString()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toFullString

      public String toFullString(SkriptPattern.StringificationProperties properties)
      Constructs a string representation of this pattern element and those that follow it.
      Parameters:
      properties - Properties to consider during stringification.
      Returns:
      A string representation of this pattern element and those that follow it.
    • getCombinations

      public abstract Set<String> getCombinations(boolean clean)
      Gets the combinations available to this PatternElement.
      Parameters:
      clean - Whether unnecessary data, determined by each implementation, should be excluded from the combinations.
      Returns:
      The combinations.
    • getAllCombinations

      public final Set<String> getAllCombinations(boolean clean)
      Gets all combinations available to this PatternElement and linked PatternElements.
      Parameters:
      clean - Whether unnecessary data, determined by each implementation, should be excluded from the combinations.
      Returns:
      The combinations.