# Class: Element

## ProtoBuf.Reflect. Element

#### new Element(type, resolvedType, isMapKey, syntax, name)

Constructs a new Element implementation that checks and converts values for a particular field type, as appropriate.

An Element represents a single value: either the value of a singular field, or a value contained in one entry of a repeated field or map field. This class does not implement these higher-level concepts; it only encapsulates the low-level typechecking and conversion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | Object | Resolved data type
`resolvedType` | ProtoBuf.Reflect.T | null | Resolved type, if relevant (e.g. submessage field).
`isMapKey` | boolean | Is this element a Map key? The value will be converted to string form if so.
`syntax` | string | Syntax level of defining message type, e.g., proto2 or proto3.
`name` | string | Name of the field containing this element (for error messages)

Source:
  - protobuf.js, line 1720

### Members

#### isMapKey :boolean

Element is a map key.

##### Type:

- boolean

Source:
  - protobuf.js, line 1738

#### name :string

Name of the field containing this element (for error messages)

##### Type:

- string

Source:
  - protobuf.js, line 1750

#### resolvedType :ProtoBuf.Reflect.T|null

Element type reference to submessage or enum definition, if needed.

##### Type:

- ProtoBuf.Reflect.T | null

Source:
  - protobuf.js, line 1732

#### syntax :string

Syntax level of defining message type, e.g., proto2 or proto3.

##### Type:

- string

Source:
  - protobuf.js, line 1744

#### type :Object

Element type, as a string (e.g., int32).

##### Type:

- Object

Source:
  - protobuf.js, line 1726

### Methods

#### (static) defaultFieldValue(type) → {*}

Returns the default value for this field in proto3.

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | string | Object | the field type

Source:
  - protobuf.js, line 1780

##### Returns:

Default value

Type
  *