Class: NameForm

NameForm


new NameForm( [json])

A form of a name.
Parameters:
Name Type Argument Description
json Object <optional>
See:

Extends

Methods


addField(field)

Add a field
Parameters:
Name Type Description
field Field
Inherited From:
Returns:
this
Type
ExtensibleData

Add a link
Parameters:
Name Type Description
link Link
Inherited From:
Returns:
this
Type
ExtensibleData

addPart(part)

Add a name part
Parameters:
Name Type Description
part NamePart | Object
Returns:
Type
NameForm

getFields()

Get the fields
Inherited From:
Returns:
Type
Array.<Field>

getFullText( [calculateIfMissing])

Get the full text
Parameters:
Name Type Argument Description
calculateIfMissing Boolean <optional>
Calculate the full text if it's not set.
Returns:
fullText
Type
String

getId()

Get the object's id.
Inherited From:
Returns:
Id
Type
String

getLang()

Get the lang tag
Returns:
lang
Type
String

Get a link
Parameters:
Name Type Description
rel String
Inherited From:
Returns:
Type
Link

Get the links
Inherited From:
Returns:
Type
Array.<Link>

getParts( [type])

Get the name parts
Parameters:
Name Type Argument Description
type String <optional>
Returns:
Type
Array.<NamePart>

init(json)

Initialize from JSON
Parameters:
Name Type Description
json Object
Overrides:
Returns:
this
Type
NameForm

<static> isInstance(obj)

Check whether the given object is an instance of this class.
Parameters:
Name Type Description
obj Object
Returns:
Type
Boolean

setFields(fields)

Set the fields
Parameters:
Name Type Description
fields Array.<Field>
Inherited From:
Returns:
this
Type
ExtensibleData

setFullText(fullText)

Set the full text
Parameters:
Name Type Description
fullText String
Returns:
This instance
Type
NameForm

setId(id)

Set the object's id.
Parameters:
Name Type Description
id String
Inherited From:
Returns:
This object, for chaining.
Type
ExtensibleData

setLang(lang)

Set the lang tag
Parameters:
Name Type Description
lang String
Returns:
This instance
Type
NameForm

Set the links
Parameters:
Name Type Description
links Links
Inherited From:
Returns:
this
Type
ExtensibleData

setParts(parts)

Set the name parts
Parameters:
Name Type Description
parts Array.<NamePart> | Array.<Object>
Returns:
This instance
Type
NameForm

toJSON()

Export the object as JSON
Overrides:
Returns:
JSON object
Type
Object