001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.databind.io;
007
008import org.eclipse.jdt.annotation.NotOwning;
009
010import java.net.URI;
011
012import edu.umd.cs.findbugs.annotations.NonNull;
013
014/**
015 * Provides objects used for parsing data associated with a specific format.
016 *
017 * @param <READER>
018 *          the format specific data reader
019 * @param <PROBLEM_HANDLER>
020 *          the format specific problem handler
021 */
022public interface IParsingContext<READER, PROBLEM_HANDLER extends IProblemHandler> {
023  /**
024   * The parser used for reading data associated with the supported format.
025   * <p>
026   * The caller does not own this reader and must not close it.
027   *
028   * @return the parser
029   */
030  @NonNull
031  @NotOwning
032  READER getReader();
033
034  /**
035   * Get the URI-based resource read by this parser.
036   *
037   * @return the resource URI
038   */
039  @NonNull
040  URI getSource();
041
042  /**
043   * A handler that provides callbacks used to resolve parsing issues.
044   *
045   * @return the configured handler
046   */
047  @NonNull
048  PROBLEM_HANDLER getProblemHandler();
049}