Class AbstractViewIOKit<M>

    • Constructor Detail

      • AbstractViewIOKit

        public AbstractViewIOKit()
        Default constructor.
      • AbstractViewIOKit

        public AbstractViewIOKit​(URIInputStreamable uriInputStreamable)
        URI input stream locator constructor.
        Parameters:
        uriInputStreamable - The implementation to use for accessing a URI for input, or null if the default implementation should be used.
      • AbstractViewIOKit

        public AbstractViewIOKit​(URIOutputStreamable uriOutputStreamable)
        URI output stream locator constructor.
        Parameters:
        uriOutputStreamable - The implementation to use for accessing a URI for output, or null if the default implementation should be used.
      • AbstractViewIOKit

        public AbstractViewIOKit​(URIInputStreamable uriInputStreamable,
                                 URIOutputStreamable uriOutputStreamable)
        Full constructor.
        Parameters:
        uriInputStreamable - The implementation to use for accessing a URI for input, or null if the default implementation should be used.
        uriOutputStreamable - The implementation to use for accessing a URI for output, or null if the default implementation should be used.
    • Method Detail

      • load

        public void load​(ModelView<M> view,
                         java.net.URI uri)
                  throws java.io.IOException
        Loads data into a view from a given URI.

        This version opens a stream and delegates to load(View, InputStream, URI).

        Specified by:
        load in interface ViewIOKit<M>
        Parameters:
        view - The view into which the data should be loaded.
        uri - The URI that identifies the resource to be loaded.
        Throws:
        java.io.IOException - Thrown if there is an error reading the data.
      • save

        public void save​(ModelView<M> view,
                         java.net.URI uri)
                  throws java.io.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.

        This version opens a stream and delegates to save(View, OutputStream).

        Specified by:
        save in interface ViewIOKit<M>
        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:
        java.io.IOException - Thrown if there is an error writing the data.
        See Also:
        Modifiable, Verifiable.verify()