001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.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   *
026   * @return the parser
027   */
028  @NonNull
029  @NotOwning
030  READER getReader();
031
032  /**
033   * Get the URI-based resource read by this parser.
034   *
035   * @return the resource URI
036   */
037  @NonNull
038  URI getSource();
039
040  /**
041   * A handler that provides callbacks used to resolve parsing issues.
042   *
043   * @return the configured handler
044   */
045  @NonNull
046  PROBLEM_HANDLER getProblemHandler();
047}