Collection
Collection+Json utility object.
Static Method Summary
Static Public Methods | ||
public static |
Create an empty Collection+Json object. |
|
public static |
getErrorMessage(collection: Object): string Get the error message from the collection object. |
|
public static |
getItemDescriptors(item: Object): Object Get an item's data (descriptors). |
|
public static |
getLinkRelationUrls(obj: Object, relationName: string): string[] Get the list of urls for a link relation from a collection or item object. |
|
public static |
getQueryParameters(queryArr: Object[]): string[] Get the list of descriptor names within a Collection+Json query array. |
|
public static |
getTemplateDescriptorNames(template: Object): string[] Get the list of descriptor names within a collection's template object. |
|
public static |
getTotalNumberOfItems(collection: Object): number Get the total number of items from a collection object. |
|
public static |
Get the url of the representation given by a collection obj. |
|
public static |
makeTemplate(descriptorsObj: Object): Object Make a Collection+Json template object from a regular object whose properties are the item descriptors. |
Static Public Methods
public static getErrorMessage(collection: Object): string source
Get the error message from the collection object.
Params:
Name | Type | Attribute | Description |
collection | Object | Collection+Json collection object |
public static getItemDescriptors(item: Object): Object source
Get an item's data (descriptors).
Params:
Name | Type | Attribute | Description |
item | Object | Collection+Json item object |
Return:
Object | object whose properties and values are the item's descriptor names and values respectively |
public static getLinkRelationUrls(obj: Object, relationName: string): string[] source
Get the list of urls for a link relation from a collection or item object.
public static getQueryParameters(queryArr: Object[]): string[] source
Get the list of descriptor names within a Collection+Json query array.
Params:
Name | Type | Attribute | Description |
queryArr | Object[] | Collection+Json query array |
public static getTemplateDescriptorNames(template: Object): string[] source
Get the list of descriptor names within a collection's template object.
Params:
Name | Type | Attribute | Description |
template | Object | Collection+Json template object |
public static getTotalNumberOfItems(collection: Object): number source
Get the total number of items from a collection object.
Params:
Name | Type | Attribute | Description |
collection | Object | Collection+Json collection object |
Return:
number | total number of items or -1 if the collection objects doesn't contain that information |