Class: ResourceReference

ResourceReference


new ResourceReference( [json])

A generic reference to a resource.
Parameters:
Name Type Argument Description
json Object <optional>
See:

Extends

Methods


getResource()

Get the resource URI
Returns:
Resource
Type
String

getResourceId()

Get the resourceId
Returns:
resourceId
Type
Boolean

init(json)

Initialize from JSON
Parameters:
Name Type Description
json Object
Overrides:
Returns:
this
Type
ResourceReference

<static> isInstance(obj)

Check whether the given object is an instance of this class.
Parameters:
Name Type Description
obj Object
Returns:
Type
Boolean

matches(resource)

Check whether this reference matches the given resource.
Parameters:
Name Type Description
resource Base Resource or ID
Returns:
Type
Boolean

setResource(uri)

Set the resource URI
Parameters:
Name Type Description
uri String
Returns:
this object
Type
ResourceReference

setResourceId(resourceId)

Set the resourceId
Parameters:
Name Type Description
resourceId Boolean
Returns:
this
Type
ResourceReference

toJSON()

Export the object as JSON
Overrides:
Returns:
JSON object
Type
Object