Skip to content

Latest commit

 

History

History
521 lines (364 loc) · 20.3 KB

API.md

File metadata and controls

521 lines (364 loc) · 20.3 KB

SirenBuilder

A fluent Siren hypermedia representation builder.

SirenBuilder.action() ⇒ SirenAction

Constructs an empty Siren action builder.

Kind: static method of SirenBuilder

SirenBuilder.entity() ⇒ SirenEntity

Constructs an empty Siren entity builder.

Kind: static method of SirenBuilder

SirenBuilder.field() ⇒ SirenField

Constructs an empty Siren field builder.

Kind: static method of SirenBuilder

SirenBuilder.link() ⇒ SirenLink

Constructs an empty Siren link builder.

Kind: static method of SirenBuilder

SirenBuilder~SirenAction

Siren action builder.

Kind: inner class of SirenBuilder

new SirenAction()

Constructs a new Siren action builder.

sirenAction.setName(name) ⇒ SirenAction

Sets the name.

Kind: instance method of SirenAction

Param Type
name String

sirenAction.addClass(className) ⇒ SirenAction

Adds a class.

Kind: instance method of SirenAction

Param Type
className String

sirenAction.setMethod(method) ⇒ SirenAction

Sets the method.

Kind: instance method of SirenAction

Param Type
method String

sirenAction.setHref(href) ⇒ SirenLink

Sets the href.

Kind: instance method of SirenAction

Param Type
href String

sirenAction.setTitle(title) ⇒ SirenLink

Sets the title.

Kind: instance method of SirenAction

Param Type
title String

sirenAction.setType(type) ⇒ SirenAction

Sets the type.

Kind: instance method of SirenAction

Param Type
type String

sirenAction.addField(name, field) ⇒ SirenAction

Adds a field.

Kind: instance method of SirenAction

Param Type
name String
field SirenField

sirenAction.copy() ⇒ SirenAction

Constructs a shallow copy.

Kind: instance method of SirenAction

sirenAction.clone() ⇒ SirenAction

Constructs a deep copy.

Kind: instance method of SirenAction

sirenAction.toJSON() ⇒ object

Builds the Siren action.

Kind: instance method of SirenAction

SirenBuilder~SirenEntity

Siren entity builder.

Kind: inner class of SirenBuilder

new SirenEntity()

Constructs a new Siren entity builder.

sirenEntity.addClass(className) ⇒ SirenEntity

Adds a class.

Kind: instance method of SirenEntity

Param Type
className String

sirenEntity.setRel(rel) ⇒ SirenEntity

Sets the rel.

Kind: instance method of SirenEntity

Param Type
rel String | Array.<String>

sirenEntity.addProperty(key, value) ⇒ SirenEntity

Adds a property key-value pair.

Kind: instance method of SirenEntity

Param Type
key String
value Any

sirenEntity.addProperties(obj) ⇒ SirenEntity

Adds a property for each key/value pair in the given object.

Object.keys(obj) is used to enumerate the keys.

Kind: instance method of SirenEntity

Param Type
obj object

sirenEntity.addEntity(rel, entity) ⇒ SirenEntity

Adds an entity as either an embedded representation or link.

Kind: instance method of SirenEntity

Param Type
rel String | Array.<String>
entity SirenEntity | SirenLink

sirenEntity.addAction(name, action) ⇒ SirenEntity

Adds an action.

Kind: instance method of SirenEntity

Param Type
name String
action SirenAction

sirenEntity.addLink(rel, link) ⇒ SirenEntity

Adds a link.

Kind: instance method of SirenEntity

Param Type
rel String | Array.<String>
link SirenLink

sirenEntity.copy() ⇒ SirenEntity

Constructs a shallow copy.

Kind: instance method of SirenEntity

sirenEntity.clone() ⇒ SirenEntity

Constructs a deep copy.

Kind: instance method of SirenEntity

sirenEntity.toJSON() ⇒ object

Builds the Siren entity.

Kind: instance method of SirenEntity

SirenBuilder~SirenField

Siren field builder.

Kind: inner class of SirenBuilder

new SirenField()

Constructs a new Siren field builder.

sirenField.setName(name) ⇒ SirenField

Sets the name.

Kind: instance method of SirenField

Param Type
name String

sirenField.addClass(className) ⇒ SirenField

Adds a class.

Kind: instance method of SirenField

Param Type
className String

sirenField.setType(type) ⇒ SirenField

Sets the type.

Kind: instance method of SirenField

Param Type
type String

sirenField.setValue(value) ⇒ SirenField

Sets the value.

Kind: instance method of SirenField

Param Type
value Any

sirenField.setTitle(title) ⇒ SirenField

Sets the title.

Kind: instance method of SirenField

Param Type
title String

sirenField.copy() ⇒ SirenField

Constructs a shallow copy.

Kind: instance method of SirenField

sirenField.clone() ⇒ SirenField

Constructs a deep copy.

Kind: instance method of SirenField

sirenField.toJSON() ⇒ object

Builds the Siren field.

Kind: instance method of SirenField

SirenBuilder~SirenLink

Siren link builder.

Kind: inner class of SirenBuilder

new SirenLink()

Constructs a new Siren link builder.

sirenLink.setRel(rel) ⇒ SirenLink

Sets the rel.

Kind: instance method of SirenLink

Param Type
rel String | Array.<String>

sirenLink.addClass(className) ⇒ SirenLink

Adds a class.

Kind: instance method of SirenLink

Param Type
className String

sirenLink.setHref(href) ⇒ SirenLink

Sets the href.

Kind: instance method of SirenLink

Param Type
href String

sirenLink.setTitle(title) ⇒ SirenLink

Sets the title.

Kind: instance method of SirenLink

Param Type
title String

sirenLink.setType(type) ⇒ SirenLink

Sets the type.

Kind: instance method of SirenLink

Param Type
type String

sirenLink.copy() ⇒ SirenLink

Constructs a shallow copy.

Kind: instance method of SirenLink

sirenLink.clone() ⇒ SirenLink

Constructs a deep copy.

Kind: instance method of SirenLink

sirenLink.toJSON() ⇒ object

Builds the Siren link.

Kind: instance method of SirenLink