Package com.globalmentor.model
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:
Modifiable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
load(ModelView<M> view, java.io.InputStream inputStream, java.net.URI baseURI)
Loads data into a view from an input stream.void
load(ModelView<M> view, java.net.URI uri)
Loads data into a view from a given URI.void
save(ModelView<M> view, java.io.OutputStream outputStream)
Saves a view to an output stream.void
save(ModelView<M> view, java.net.URI uri)
Saves a view to a given URI.-
Methods inherited from interface com.globalmentor.io.URIInputStreamable
getInputStream
-
Methods inherited from interface com.globalmentor.io.URIOutputStreamable
getOutputStream
-
-
-
-
Method Detail
-
load
void load(ModelView<M> view, java.net.URI uri) throws java.io.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:
java.io.IOException
- Thrown if there is an error reading the data.
-
load
void load(ModelView<M> view, java.io.InputStream inputStream, java.net.URI baseURI) throws java.io.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, ornull
if no base URI is available.- Throws:
java.io.IOException
- Thrown if there is an error reading the data.
-
save
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 tofalse
.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:
java.io.IOException
- Thrown if there is an error writing the data.- See Also:
Modifiable
,Verifiable.verify()
-
save
void save(ModelView<M> view, java.io.OutputStream outputStream) throws java.io.IOException
Saves a view to an output stream.If saving is successful and the view is
Modifiable
, the view's modified status is set tofalse
.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:
java.io.IOException
- Thrown if there is an error writing the data.- See Also:
Modifiable
,Verifiable.verify()
-
-