Interface ObjectParser<T>

Type Parameters:
T - The object type.
All Known Subinterfaces:
ItemParser, ThingParser

@NonNullByDefault public interface ObjectParser<T>
A generic interface for parsers that parse strings into specific object types like Things, Items, Rules etc.
Author:
Ravi Nadahar - Initial contribution
  • Method Details

    • getParserFormat

      String getParserFormat()
      Get the name of the format.
      Returns:
      The format name.
    • startParsingFormat

      @Nullable String startParsingFormat(String syntax, List<String> errors, List<String> warnings)
      Parse the provided syntax in format without impacting any object registries.
      Parameters:
      syntax - the syntax in format.
      errors - the List to use to report errors.
      warnings - the List to be used to report warnings.
      Returns:
      The model name used for parsing if the parsing succeeded without errors; null otherwise.
    • getParsedObjects

      Collection<T> getParsedObjects(String modelName)
      Get the objects found when parsing the format.
      Parameters:
      modelName - the model name whose objects to get.
      Returns:
      The Collection of objects.
    • finishParsingFormat

      void finishParsingFormat(String modelName)
      Release the resources from a previously started format parsing.
      Parameters:
      modelName - the model name whose resources to release.