A fluent Siren hypermedia representation builder.
- SirenBuilder
- static
- inner
- ~SirenAction
- new SirenAction()
- .setName(name) ⇒
SirenAction
- .addClass(className) ⇒
SirenAction
- .setMethod(method) ⇒
SirenAction
- .setHref(href) ⇒
SirenLink
- .setTitle(title) ⇒
SirenLink
- .setType(type) ⇒
SirenAction
- .addField(name, field) ⇒
SirenAction
- .copy() ⇒
SirenAction
- .clone() ⇒
SirenAction
- .toJSON() ⇒
object
- ~SirenEntity
- new SirenEntity()
- .addClass(className) ⇒
SirenEntity
- .setRel(rel) ⇒
SirenEntity
- .addProperty(key, value) ⇒
SirenEntity
- .addProperties(obj) ⇒
SirenEntity
- .addEntity(rel, entity) ⇒
SirenEntity
- .addAction(name, action) ⇒
SirenEntity
- .addLink(rel, link) ⇒
SirenEntity
- .copy() ⇒
SirenEntity
- .clone() ⇒
SirenEntity
- .toJSON() ⇒
object
- ~SirenField
- new SirenField()
- .setName(name) ⇒
SirenField
- .addClass(className) ⇒
SirenField
- .setType(type) ⇒
SirenField
- .setValue(value) ⇒
SirenField
- .setTitle(title) ⇒
SirenField
- .copy() ⇒
SirenField
- .clone() ⇒
SirenField
- .toJSON() ⇒
object
- ~SirenLink
- new SirenLink()
- .setRel(rel) ⇒
SirenLink
- .addClass(className) ⇒
SirenLink
- .setHref(href) ⇒
SirenLink
- .setTitle(title) ⇒
SirenLink
- .setType(type) ⇒
SirenLink
- .copy() ⇒
SirenLink
- .clone() ⇒
SirenLink
- .toJSON() ⇒
object
- ~SirenAction
Constructs an empty Siren action builder.
Kind: static method of SirenBuilder
Constructs an empty Siren entity builder.
Kind: static method of SirenBuilder
Constructs an empty Siren field builder.
Kind: static method of SirenBuilder
Constructs an empty Siren link builder.
Kind: static method of SirenBuilder
Siren action builder.
Kind: inner class of SirenBuilder
- ~SirenAction
- new SirenAction()
- .setName(name) ⇒
SirenAction
- .addClass(className) ⇒
SirenAction
- .setMethod(method) ⇒
SirenAction
- .setHref(href) ⇒
SirenLink
- .setTitle(title) ⇒
SirenLink
- .setType(type) ⇒
SirenAction
- .addField(name, field) ⇒
SirenAction
- .copy() ⇒
SirenAction
- .clone() ⇒
SirenAction
- .toJSON() ⇒
object
Constructs a new Siren action builder.
Sets the name.
Kind: instance method of SirenAction
Param | Type |
---|---|
name | String |
Adds a class.
Kind: instance method of SirenAction
Param | Type |
---|---|
className | String |
Sets the method.
Kind: instance method of SirenAction
Param | Type |
---|---|
method | String |
Sets the href.
Kind: instance method of SirenAction
Param | Type |
---|---|
href | String |
Sets the title.
Kind: instance method of SirenAction
Param | Type |
---|---|
title | String |
Sets the type.
Kind: instance method of SirenAction
Param | Type |
---|---|
type | String |
Adds a field.
Kind: instance method of SirenAction
Param | Type |
---|---|
name | String |
field | SirenField |
Constructs a shallow copy.
Kind: instance method of SirenAction
Constructs a deep copy.
Kind: instance method of SirenAction
Builds the Siren action.
Kind: instance method of SirenAction
Siren entity builder.
Kind: inner class of SirenBuilder
- ~SirenEntity
- new SirenEntity()
- .addClass(className) ⇒
SirenEntity
- .setRel(rel) ⇒
SirenEntity
- .addProperty(key, value) ⇒
SirenEntity
- .addProperties(obj) ⇒
SirenEntity
- .addEntity(rel, entity) ⇒
SirenEntity
- .addAction(name, action) ⇒
SirenEntity
- .addLink(rel, link) ⇒
SirenEntity
- .copy() ⇒
SirenEntity
- .clone() ⇒
SirenEntity
- .toJSON() ⇒
object
Constructs a new Siren entity builder.
Adds a class.
Kind: instance method of SirenEntity
Param | Type |
---|---|
className | String |
Sets the rel.
Kind: instance method of SirenEntity
Param | Type |
---|---|
rel | String | Array.<String> |
Adds a property key-value pair.
Kind: instance method of SirenEntity
Param | Type |
---|---|
key | String |
value | Any |
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 |
Adds an entity as either an embedded representation or link.
Kind: instance method of SirenEntity
Param | Type |
---|---|
rel | String | Array.<String> |
entity | SirenEntity | SirenLink |
Adds an action.
Kind: instance method of SirenEntity
Param | Type |
---|---|
name | String |
action | SirenAction |
Adds a link.
Kind: instance method of SirenEntity
Param | Type |
---|---|
rel | String | Array.<String> |
link | SirenLink |
Constructs a shallow copy.
Kind: instance method of SirenEntity
Constructs a deep copy.
Kind: instance method of SirenEntity
Builds the Siren entity.
Kind: instance method of SirenEntity
Siren field builder.
Kind: inner class of SirenBuilder
- ~SirenField
- new SirenField()
- .setName(name) ⇒
SirenField
- .addClass(className) ⇒
SirenField
- .setType(type) ⇒
SirenField
- .setValue(value) ⇒
SirenField
- .setTitle(title) ⇒
SirenField
- .copy() ⇒
SirenField
- .clone() ⇒
SirenField
- .toJSON() ⇒
object
Constructs a new Siren field builder.
Sets the name.
Kind: instance method of SirenField
Param | Type |
---|---|
name | String |
Adds a class.
Kind: instance method of SirenField
Param | Type |
---|---|
className | String |
Sets the type.
Kind: instance method of SirenField
Param | Type |
---|---|
type | String |
Sets the value.
Kind: instance method of SirenField
Param | Type |
---|---|
value | Any |
Sets the title.
Kind: instance method of SirenField
Param | Type |
---|---|
title | String |
Constructs a shallow copy.
Kind: instance method of SirenField
Constructs a deep copy.
Kind: instance method of SirenField
Builds the Siren field.
Kind: instance method of SirenField
Siren link builder.
Kind: inner class of SirenBuilder
- ~SirenLink
- new SirenLink()
- .setRel(rel) ⇒
SirenLink
- .addClass(className) ⇒
SirenLink
- .setHref(href) ⇒
SirenLink
- .setTitle(title) ⇒
SirenLink
- .setType(type) ⇒
SirenLink
- .copy() ⇒
SirenLink
- .clone() ⇒
SirenLink
- .toJSON() ⇒
object
Constructs a new Siren link builder.
Sets the rel.
Kind: instance method of SirenLink
Param | Type |
---|---|
rel | String | Array.<String> |
Adds a class.
Kind: instance method of SirenLink
Param | Type |
---|---|
className | String |
Sets the href.
Kind: instance method of SirenLink
Param | Type |
---|---|
href | String |
Sets the title.
Kind: instance method of SirenLink
Param | Type |
---|---|
title | String |
Sets the type.
Kind: instance method of SirenLink
Param | Type |
---|---|
type | String |
Constructs a shallow copy.
Kind: instance method of SirenLink
Constructs a deep copy.
Kind: instance method of SirenLink
Builds the Siren link.
Kind: instance method of SirenLink