Class ResourceModel<R extends Resource>

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:
  • Field Details

    • RESOURCE_PROPERTY

      public final String RESOURCE_PROPERTY
      The resource property.
  • Constructor Details

    • ResourceModel

      public ResourceModel()
      Default constructor.
    • ResourceModel

      public ResourceModel(R resource)
      Resource constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
    • ResourceModel

      public ResourceModel(URI baseURI)
      Base URI constructor.
      Parameters:
      baseURI - The base URI of the model, or null if unknown.
    • ResourceModel

      public ResourceModel(R resource, URI baseURI)
      Resource and base URI constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
      baseURI - The base URI of the model, or null if unknown.
    • ResourceModel

      public ResourceModel(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.
    • ResourceModel

      public ResourceModel(R resource, URIInputStreamable uriInputStreamable)
      Resource and URI input stream locator constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
      uriInputStreamable - The implementation to use for accessing a URI for input, or null 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, or null if there is no resource.
      uriOutputStreamable - The implementation to use for accessing a URI for output, or null if the default implementation should be used.
    • ResourceModel

      public ResourceModel(URI baseURI, URIInputStreamable uriInputStreamable)
      Base URI and input stream locator constructor.
      Parameters:
      baseURI - The base URI of the model, or null if unknown.
      uriInputStreamable - The implementation to use for accessing a URI for input, or null if the default implementation should be used.
    • ResourceModel

      public ResourceModel(R resource, URI baseURI, URIInputStreamable uriInputStreamable)
      Resource, base URI, and input stream locator constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
      baseURI - The base URI of the model, or null if unknown.
      uriInputStreamable - The implementation to use for accessing a URI for input, or null if the default implementation should be used.
    • ResourceModel

      public ResourceModel(R resource, URI baseURI, URIAccessible uriAccessible)
      Resource, base URI, and URI accessible constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
      baseURI - The base URI of the model, or null if unknown.
      uriAccessible - The implementation to use for accessing a URI for input and output, or null if the default implementation should be used.
    • ResourceModel

      public ResourceModel(R resource, URI baseURI, URIOutputStreamable uriOutputStreamable)
      Resource, base URI, and output stream locator constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
      baseURI - The base URI of the model, or null if unknown.
      uriOutputStreamable - The implementation to use for accessing a URI for output, or null 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, or null if there is no resource.
      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.
    • ResourceModel

      public ResourceModel(R resource, URI baseURI, URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable)
      Full constructor.
      Parameters:
      resource - The resource being modeled, or null if there is no resource.
      baseURI - The base URI of the model, or null if unknown.
      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 Details

    • 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, or null if there is no resource.