Package com.globalmentor.model
Class AbstractViewIOKit<M>
java.lang.Object
com.globalmentor.beans.BoundPropertyObject
com.globalmentor.io.DefaultURIAccessible
com.globalmentor.model.AbstractViewIOKit<M>
- All Implemented Interfaces:
PropertyBindable
,PropertyConstrainable
,URIAccessible
,URIInputStreamable
,URIOutputStreamable
,ViewIOKit<M>
- Direct Known Subclasses:
ModelViewIOKit
Absract implementation of loading information into a view or saving information from a view.
- Author:
- Garret Wilson
- See Also:
-
Field Summary
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Constructor Summary
ConstructorDescriptionDefault constructor.AbstractViewIOKit
(URIInputStreamable uriInputStreamable) URI input stream locator constructor.AbstractViewIOKit
(URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable) Full constructor.AbstractViewIOKit
(URIOutputStreamable uriOutputStreamable) URI output stream locator constructor. -
Method Summary
Methods inherited from class com.globalmentor.io.DefaultURIAccessible
getDefaultURIAccessible, getInputStream, getOutputStream, getPassword, getUsername, setPassword, setUsername
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.globalmentor.io.URIInputStreamable
getInputStream
Methods inherited from interface com.globalmentor.io.URIOutputStreamable
getOutputStream
-
Constructor Details
-
AbstractViewIOKit
public AbstractViewIOKit()Default constructor. -
AbstractViewIOKit
URI input stream locator constructor.- Parameters:
uriInputStreamable
- The implementation to use for accessing a URI for input, ornull
if the default implementation should be used.
-
AbstractViewIOKit
URI output stream locator constructor.- Parameters:
uriOutputStreamable
- The implementation to use for accessing a URI for output, ornull
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, ornull
if the default implementation should be used.uriOutputStreamable
- The implementation to use for accessing a URI for output, ornull
if the default implementation should be used.
-
-
Method Details
-
load
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 interfaceViewIOKit<M>
- 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.
-
save
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.This version opens a stream and delegates to
save(View, OutputStream)
.- Specified by:
save
in interfaceViewIOKit<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:
IOException
- Thrown if there is an error writing the data.- See Also:
-