new FieldDescriptor( [json])
Metadata about the structure and layout of a field, as well as the expected
data to be extracted from a field.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
json |
Object |
<optional> |
Extends
Methods
-
addField(field)
-
Add a field
Parameters:
Name Type Description field
Field - Inherited From:
Returns:
this- Type
- ExtensibleData
-
addLink(link)
-
Add a link
Parameters:
Name Type Description link
Link - Inherited From:
Returns:
this- Type
- ExtensibleData
-
getFields()
-
Get the fields
- Inherited From:
Returns:
- Type
- Array.<Field>
-
getId()
-
Get the object's id.
- Inherited From:
Returns:
Id- Type
- String
-
getLink(rel)
-
Get a link
Parameters:
Name Type Description rel
String - Inherited From:
Returns:
- Type
- Link
-
getLinks()
-
Get the links
- Inherited From:
Returns:
- Type
- Array.<Link>
-
init(json)
-
Initialize from JSON
Parameters:
Name Type Description json
Object - Inherited From:
Returns:
this- Type
- ExtensibleData
-
setFields(fields)
-
Set the fields
Parameters:
Name Type Description fields
Array.<Field> - Inherited From:
Returns:
this- Type
- ExtensibleData
-
setId(id)
-
Set the object's id.
Parameters:
Name Type Description id
String - Inherited From:
Returns:
This object, for chaining.- Type
- ExtensibleData
-
setLinks(links)
-
Set the links
Parameters:
Name Type Description links
Links - Inherited From:
Returns:
this- Type
- ExtensibleData
-
toJSON()
-
Export the object as JSON
- Inherited From:
Returns:
JSON object- Type
- Object