ValidatedResource (Common API)

Overview - Common API - Client API - Admin API - Runtime API

ValidatedResource

ValidatedResource is a Resource that can validate that property changes (or the whole instance) do not violate the structure of the type information associated with the instance.

Details

  • Extends Resource

  • Module common

See also

Method Summary

Name Returns Description
addArrayValue void Adds an array property value, validating that it does not violate the model
setPropertyValue void Sets a property, validating that it does not violate the model
validate void Validates the instance against its model

Inherited Method Summary

Supertype Name Returns Description
Identifiable isRelationship boolean Determine if this identifiable is a relationship
Resource toString String Returns the string representation of this class
Resource toJSON Object Serialize this resource into a JavaScript object suitable for serialization to JSON, using the default options for the serializer
Identifiable getIdentifier string Get the identifier of this instance
Identifiable setIdentifier void Set the identifier of this instance
Identifiable getFullyQualifiedIdentifier string Get the fully qualified identifier of this instance
Identifiable toString String Returns the string representation of this class
Resource isResource boolean Determine if this identifiable is a resource
Identifiable isResource boolean Determine if this identifiable is a resource
Identifiable toURI String Returns a URI representation of a reference to this identifiable
Typed getType string Get the type of the instance (a short name, not including namespace)
Typed getFullyQualifiedType string Get the fully-qualified type name of the instance (including namespace)
Typed getNamespace string Get the namespace of the instance
Typed instanceOf boolean Check to see if this instance is an instance of the specified fully qualified type name

Method Details

setPropertyValue

setPropertyValue( string propname, string value )

Sets a property, validating that it does not violate the model

Parameters

Name Type Mandatory Description
propName string Yes the name of the field
value string Yes the value of the property

addArrayValue

addArrayValue( string propname, string value )

Adds an array property value, validating that it does not violate the model

Parameters

Name Type Mandatory Description
propName string Yes the name of the field
value string Yes the value of the property

validate

validate( )

Validates the instance against its model.

Parameters

No parameters

Inherited methods

toString

String toString( )

Inherited from: Resource

Returns the string representation of this class

Returns

String - the string representation of the class

Parameters

No parameters

isResource

boolean isResource( )

Inherited from: Resource

Determine if this identifiable is a resource.

Returns

boolean - True if this identifiable is a resource, false if not.

Parameters

No parameters

toJSON

Object toJSON( )

Inherited from: Resource

Serialize this resource into a JavaScript object suitable for serialization to JSON, using the default options for the serializer. If you need to set additional options for the serializer, use the Serializer#toJSON method instead.

Returns

Object - A JavaScript object suitable for serialization to JSON.

Parameters

No parameters

getIdentifier

string getIdentifier( )

Inherited from: Identifiable

Get the identifier of this instance

Returns

string - The identifier for this object

Parameters

No parameters

setIdentifier

void setIdentifier( string id )

Inherited from: Identifiable

Set the identifier of this instance

Parameters

Name Type Mandatory Description
id string Yes the new identifier for this object

getFullyQualifiedIdentifier

string getFullyQualifiedIdentifier( )

Inherited from: Identifiable

Get the fully qualified identifier of this instance. (namespace '.' type '#' identifier).

Returns

string - the fully qualified identifier of this instance

Parameters

No parameters

toString

String toString( )

Inherited from: Identifiable

Returns the string representation of this class

Returns

String - the string representation of the class

Parameters

No parameters

isRelationship

boolean isRelationship( )

Inherited from: Identifiable

Determine if this identifiable is a relationship.

Returns

boolean - True if this identifiable is a relationship, false if not.

Parameters

No parameters

isResource

boolean isResource( )

Inherited from: Identifiable

Determine if this identifiable is a resource.

Returns

boolean - True if this identifiable is a resource, false if not.

Parameters

No parameters

toURI

String toURI( )

Inherited from: Identifiable

Returns a URI representation of a reference to this identifiable

Returns

String - the URI for the identifiable

Parameters

No parameters

getType

string getType( )

Inherited from: Typed

Get the type of the instance (a short name, not including namespace).

Returns

string - The type of this object

Parameters

No parameters

getFullyQualifiedType

string getFullyQualifiedType( )

Inherited from: Typed

Get the fully-qualified type name of the instance (including namespace).

Returns

string - The fully-qualified type name of this object

Parameters

No parameters

getNamespace

string getNamespace( )

Inherited from: Typed

Get the namespace of the instance.

Returns

string - The namespace of this object

Parameters

No parameters

instanceOf

boolean instanceOf( String fqt )

Inherited from: Typed

Check to see if this instance is an instance of the specified fully qualified type name.

Returns

boolean - True if this instance is an instance of the specified fully qualified type name, false otherwise.

Parameters

Name Type Mandatory Description
fqt String Yes The fully qualified type name.