new FieldBase(name, id, type, rule, extend, options)
Not an actual constructor. Use Field instead.
| Name | Type | Default | Description | 
|---|---|---|---|
name | 
            
            
            string | 
                
                    
                    
                        
                    
                
                 Unique name within its namespace  | 
        |
id | 
            
            
            number | 
                
                    
                    
                        
                    
                
                 Unique id within its namespace  | 
        |
type | 
            
            
            string | 
                
                    
                    
                        
                    
                
                 Value type  | 
        |
rule | 
            
            
            string | Object.<string, *> | "optional" | 
                
                    
                        optional
                    
                    
                        
                    
                
                 Field rule  | 
        
extend | 
            
            
            string | Object.<string, *> | 
                
                    
                        optional
                    
                    
                        
                    
                
                 Extended type if different from parent  | 
        |
options | 
            
            
            Object.<string, *> | 
                
                    
                        optional
                    
                    
                        
                    
                
                 Declared options  | 
        
Extends
Members
- 
    
bytes { boolean }
 - 
    
    
Whether this field's value is a buffer.
 - 
    
comment { string | null }
 - 
    
    
Comment text, if any.
 - 
    
declaringField { Field | null }
 - 
    
    
Sister-field within the declaring namespace if an extended field.
 - 
    
defaultValue { * }
 - 
    
    
The field's default value on prototypes.
 - 
    
extend { string | undefined }
 - 
    
    
Extended type if different from parent.
 - 
    
extensionField { Field | null }
 - 
    
    
Sister-field within the extended type if a declaring extension field.
 - 
    
filename { string | null }
 - 
    
    
Defining file name.
 - 
    
fullName readonly{ string }
 - 
    
    
Full name including leading dot.
 - 
    
id { number }
 - 
    
    
Unique field id.
 - 
    
long { boolean }
 - 
    
    
Whether this field's value should be treated as a long.
 - 
    
map { boolean }
 - 
    
    
Whether this field is a map or not.
 - 
    
message { Type | null }
 - 
    
    
Message this field belongs to.
 - 
    
name { string }
 - 
    
    
Unique name within its namespace.
 - 
    
optional { boolean }
 - 
    
    
Whether this field is optional.
 - 
    
options { Object<string, *> | undefined }
 - 
    
    
Options.
 - 
    
parent { Namespace | null }
 - 
    
    
Parent namespace.
 - 
    
partOf { OneOf | null }
 - 
    
    
OneOf this field belongs to, if any,
 - 
    
repeated { boolean }
 - 
    
    
Whether this field is repeated.
 - 
    
required { boolean }
 - 
    
    
Whether this field is required.
 - 
    
resolved { boolean }
 - 
    
    
Whether already resolved or not.
 - 
    
    
Resolved type if not a basic type.
 - 
    
root readonly{ Root }
 - 
    
    
Reference to the root namespace.
 - 
    
rule { string | undefined }
 - 
    
    
Field rule, if any.
 - 
    
type { string }
 - 
    
    
Field type.
 - 
    
typeDefault { * }
 - 
    
    
The field type's default value.
 
Methods
- 
    
inherited getOption(name){ * }
 - 
    
    
    
Gets an option value.
Name Type Description namestring Option name
Returns:
Type Description * Option value or undefinedif not set - 
    
inherited onAdd(parent){ undefined }
 - 
    
    
    
Called when this object is added to a parent.
Name Type Description parentReflectionObject Parent added to
Returns:
Type Description undefined  - 
    
inherited onRemove(parent){ undefined }
 - 
    
    
    
Called when this object is removed from a parent.
Name Type Description parentReflectionObject Parent removed from
Returns:
Type Description undefined  - 
    
resolve(){ Field }
 - 
    
    
    
Resolves this field's type references.
Throws:
Type Description Error If any reference cannot be resolved
Returns:
Type Description Field this - 
    
inherited setOption(name, value, ifNotSet){ ReflectionObject }
 - 
    
    
    
Sets an option.
Name Type Description namestring Option name
value* Option value
ifNotSetboolean optional Sets the option only if it isn't currently set
Returns:
Type Description ReflectionObject this - 
    
inherited setOptions(options, ifNotSet){ ReflectionObject }
 - 
    
    
    
Sets multiple options.
Name Type Description optionsObject.<string, *> Options to set
ifNotSetboolean optional Sets an option only if it isn't currently set
Returns:
Type Description ReflectionObject this - 
    
toJSON(){ IField }
 - 
    
    
    
Converts this field to a field descriptor.
Returns:
Type Description IField Field descriptor  - 
    
inherited toString(){ string }
 - 
    
    
    
Converts this instance to its string representation.
Returns:
Type Description string Class name[, space, full name]