Class LiteralParseCache

java.lang.Object
ch.njol.skript.lang.parser.LiteralParseCache

public final class LiteralParseCache extends Object
A cache for literal data strings that failed Classes.parse(data, Object.class, context).

Results of Classes.parse depend only on registered ClassInfo parsers and ParseContext, neither of which change during script loading. This cache is therefore safe to retain for an entire script load batch.

  • Constructor Details

    • LiteralParseCache

      public LiteralParseCache()
  • Method Details

    • contains

      public boolean contains(LiteralParseCache.Failure failure)
      Returns true if the given literal data string is known to be unparsable in the given context.
    • add

      public void add(LiteralParseCache.Failure failure)
      Marks a literal parse attempt as failed.
    • clear

      public void clear()
      Clears all cached failures.