Package com.globalmentor.net
Class ResourceModel<R extends Resource>
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- com.globalmentor.io.DefaultURIAccessible
-
- com.globalmentor.io.URIAccessibleModel
-
- com.globalmentor.net.ResourceModel<R>
-
- All Implemented Interfaces:
PropertyBindable
,PropertyConstrainable
,URIAccessible
,URIInputStreamable
,URIOutputStreamable
,Model
public class ResourceModel<R extends Resource> extends URIAccessibleModel
A model of a resource.Bound properties:
RESOURCE_PROPERTY
(Resource
)- Indicates that the resource property has been changed.
- Author:
- Garret Wilson
- See Also:
RESOURCE_PROPERTY
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
RESOURCE_PROPERTY
The resource property.-
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Fields inherited from interface com.globalmentor.model.Model
MODEL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ResourceModel()
Default constructor.ResourceModel(URIInputStreamable uriInputStreamable)
URI input stream locator constructor.ResourceModel(java.net.URI baseURI)
Base URI constructor.ResourceModel(java.net.URI baseURI, URIInputStreamable uriInputStreamable)
Base URI and input stream locator constructor.ResourceModel(R resource)
Resource constructor.ResourceModel(R resource, URIInputStreamable uriInputStreamable)
Resource and URI input stream locator constructor.ResourceModel(R resource, URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable)
Resource and input/output stream locator constructor.ResourceModel(R resource, URIOutputStreamable uriOutputStreamable)
Resource and URI output stream locator constructor.ResourceModel(R resource, java.net.URI baseURI)
Resource and base URI constructor.ResourceModel(R resource, java.net.URI baseURI, URIAccessible uriAccessible)
Resource, base URI, and URI accessible constructor.ResourceModel(R resource, java.net.URI baseURI, URIInputStreamable uriInputStreamable)
Resource, base URI, and input stream locator constructor.ResourceModel(R resource, java.net.URI baseURI, URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable)
Full constructor.ResourceModel(R resource, java.net.URI baseURI, URIOutputStreamable uriOutputStreamable)
Resource, base URI, and output stream locator constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
getResource()
void
setResource(R newResource)
Sets the resource being modeled.-
Methods inherited from class com.globalmentor.io.URIAccessibleModel
getBaseURI, getEventListenerManager
-
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
-
-
-
-
Constructor Detail
-
ResourceModel
public ResourceModel()
Default constructor.
-
ResourceModel
public ResourceModel(R resource)
Resource constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.
-
ResourceModel
public ResourceModel(java.net.URI baseURI)
Base URI constructor.- Parameters:
baseURI
- The base URI of the model, ornull
if unknown.
-
ResourceModel
public ResourceModel(R resource, java.net.URI baseURI)
Resource and base URI constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.baseURI
- The base URI of the model, ornull
if unknown.
-
ResourceModel
public ResourceModel(URIInputStreamable uriInputStreamable)
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.
-
ResourceModel
public ResourceModel(R resource, URIInputStreamable uriInputStreamable)
Resource and URI input stream locator constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.uriInputStreamable
- The implementation to use for accessing a URI for input, ornull
if the default implementation should be used.
-
ResourceModel
public ResourceModel(R resource, URIOutputStreamable uriOutputStreamable)
Resource and URI output stream locator constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.uriOutputStreamable
- The implementation to use for accessing a URI for output, ornull
if the default implementation should be used.
-
ResourceModel
public ResourceModel(java.net.URI baseURI, URIInputStreamable uriInputStreamable)
Base URI and input stream locator constructor.- Parameters:
baseURI
- The base URI of the model, ornull
if unknown.uriInputStreamable
- The implementation to use for accessing a URI for input, ornull
if the default implementation should be used.
-
ResourceModel
public ResourceModel(R resource, java.net.URI baseURI, URIInputStreamable uriInputStreamable)
Resource, base URI, and input stream locator constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.baseURI
- The base URI of the model, ornull
if unknown.uriInputStreamable
- The implementation to use for accessing a URI for input, ornull
if the default implementation should be used.
-
ResourceModel
public ResourceModel(R resource, java.net.URI baseURI, URIAccessible uriAccessible)
Resource, base URI, and URI accessible constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.baseURI
- The base URI of the model, ornull
if unknown.uriAccessible
- The implementation to use for accessing a URI for input and output, ornull
if the default implementation should be used.
-
ResourceModel
public ResourceModel(R resource, java.net.URI baseURI, URIOutputStreamable uriOutputStreamable)
Resource, base URI, and output stream locator constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.baseURI
- The base URI of the model, ornull
if unknown.uriOutputStreamable
- The implementation to use for accessing a URI for output, ornull
if the default implementation should be used.
-
ResourceModel
public ResourceModel(R resource, URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable)
Resource and input/output stream locator constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.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.
-
ResourceModel
public ResourceModel(R resource, java.net.URI baseURI, URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable)
Full constructor.- Parameters:
resource
- The resource being modeled, ornull
if there is no resource.baseURI
- The base URI of the model, ornull
if unknown.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 Detail
-
getResource
public R getResource()
- Returns:
- The resource being modeled, or
null
if there is no resource.
-
setResource
public void setResource(R newResource)
Sets the resource being modeled. This is a bound property.- Parameters:
newResource
- The resource being modeled, ornull
if there is no resource.
-
-