Interface ViewIOKit<M>

All Superinterfaces:
URIAccessible, URIInputStreamable, URIOutputStreamable
All Known Implementing Classes:
AbstractViewIOKit, ModelViewIOKit

public interface ViewIOKit<M> extends URIAccessible
Represents an implementation for loading information into a view or saving information from a view.
Author:
Garret Wilson
See Also:
  • Method Details

    • load

      void load(ModelView<M> view, URI uri) throws IOException
      Loads data into a view from a given URI.
      Parameters:
      view - The view into which the data should be loaded.
      uri - The URI that identifies the resource to be loaded.
      Throws:
      IOException - Thrown if there is an error reading the data.
    • load

      void load(ModelView<M> view, InputStream inputStream, URI baseURI) throws IOException
      Loads data into a view from an input stream.
      Parameters:
      view - The view into which the data should be loaded.
      inputStream - The input stream from which to read the data.
      baseURI - The base URI of the content, or null if no base URI is available.
      Throws:
      IOException - Thrown if there is an error reading the data.
    • save

      void save(ModelView<M> view, URI uri) throws IOException
      Saves a view to a given URI.

      If saving is successful and the view is Modifiable, the view's modified status is set to false.

      A calling program should first call the view's verify() method to ensure the data is valid and that the model reflects the currently entered data.

      Parameters:
      view - The view the data of which will be saved at the given URI.
      uri - The URI at which the view data should be saved.
      Throws:
      IOException - Thrown if there is an error writing the data.
      See Also:
    • save

      void save(ModelView<M> view, OutputStream outputStream) throws IOException
      Saves a view to an output stream.

      If saving is successful and the view is Modifiable, the view's modified status is set to false.

      A calling program should first call the view's verify() method to ensure the data is valid and that the model reflects the currently entered data.

      Parameters:
      view - The view the data of which will be written to the given output stream.
      outputStream - The output stream to which to write the model content.
      Throws:
      IOException - Thrown if there is an error writing the data.
      See Also: