Creates the checks which are common to each file type
@param fieldDefinition The field_definition for this field.
@param fieldName The name of the current field
487299
function (fieldDefinition, fieldName) {
		const severity = propertyHelper.getSeverity(fieldDefinition, undefined, 'mandatory');
		const isMandatoy = propertyHelper.getProperty(fieldDefinition, undefined, 'mandatory');

		// const severity = fieldDefinition.severity;
		// const isMandatoy = fieldDefinition.mandatory;

		if (isMandatoy === true) {
			/**
			 * Just check if for mandatory fields the value is given
			 * @param content the content hash to be validated.
			 */
			return function (content) {
				// get the value from the content hash
				const valueToCheck = content[fieldName];

				// If the value is defined, we need to check it
				if (valueToCheck === undefined || valueToCheck === null) {
					return {
						errorCode: 'MANDATORY_VALUE_MISSING',
						severity: severity,
						fieldName: fieldName
					};
				}
			};

		}
	}
48611
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        // @todo: Is it possible to store a default value in the DB?
        $fieldDef->defaultValue = new FieldValue();
        $fieldDef->defaultValue->data = array('text' => null);
    }
210638
protected function generateChangeFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
    {
        $fieldType = strstr(  $this->generateFieldSql( $fieldName, $fieldDefinition ), ' ' );
        if ( $fieldDefinition->autoIncrement ) 
        {
            $this->queries[] = "CREATE SEQUENCE \"{$tableName}_{$fieldName}_seq\"";
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER \"$fieldName\" TYPE INTEGER";
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER COLUMN \"$fieldName\" SET DEFAULT nextval('{$tableName}_{$fieldName}_seq')";
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER COLUMN \"$fieldName\" SET NOT NULL";
        }
        else
        {
            $this->queries[] = "ALTER TABLE \"$tableName\" ALTER \"$fieldName\" TYPE".$fieldType." USING CAST(\"$fieldName\" AS $fieldType)";
        }
    }
66635
@SuppressWarnings("unchecked") // bla bla, we know what we are doing here...
    @JsonProperty("definitions")
    private void deserializeDefinitionsField(Map<String, Object> defs) {
        definitionsBean = new JsonGouldiDefinitionsBean();
        LinkedList<JsonGouldiIdentifierDefinienBean> list = new LinkedList<>();
        definitionsBean.setIdentifierDefiniens(list);

        for (String key : defs.keySet()) {
            JsonGouldiIdentifierDefinienBean bean = new JsonGouldiIdentifierDefinienBean();
            ArrayList<JsonGouldiWikidataDefinienBean> arrList = new ArrayList<>();
            bean.setName(key);

            ArrayList<Object> identifierList = (ArrayList<Object>) defs.get(key);
            for (Object obj : identifierList) {
                if (obj instanceof String) {
                    JsonGouldiTextDefinienBean textBean = new JsonGouldiTextDefinienBean();
                    textBean.setDiscription((String) obj);
                    arrList.add(textBean);
                } else {
                    Map<String, String> qidMappings = (Map<String, String>) obj;
                    for (String qID : qidMappings.keySet()) {
                        JsonGouldiWikidataDefinienBean wikidefbean = new JsonGouldiWikidataDefinienBean();
                        wikidefbean.setWikiID(qID);
                        wikidefbean.setDiscription(qidMappings.get(qID));
                        arrList.add(wikidefbean);
                    }
                }
            }

            JsonGouldiWikidataDefinienBean[] arr = new JsonGouldiWikidataDefinienBean[arrList.size()];
            arr = arrList.toArray(arr);
            bean.setDefiniens(arr);
            list.add(bean);
        }
    }
117665
public void addNotEqualToField(String attribute, String fieldName)
    {
        // PAW
		// SelectionCriteria c = FieldCriteria.buildNotEqualToCriteria(attribute, fieldName, getAlias());
		SelectionCriteria c = FieldCriteria.buildNotEqualToCriteria(attribute, fieldName, getUserAlias(attribute));
        addSelectionCriteria(c);
    }
306426
static String generateCheckInitializer(
            final String className,
            final String checkName,
            final String fieldName,
            final String annotationTypeName) {
        return checkName + ".configure(\n"
                + className + ".class.getDeclaredField(\"" + fieldName + "\")\n"
                + ".getDeclaredAnnotation(" + annotationTypeName + ".class));\n";
    }
894466
public void addField(String fieldName) throws QueryException {
		EReference feature = null;
		for (TypeDef typeDef : types) {
			if (typeDef.geteClass().getEStructuralFeature(fieldName) == null) {
				throw new QueryException("Class \"" + typeDef.geteClass().getName() + "\" does not have the field \"" + fieldName + "\"");
			}
			if (feature == null) {
				if (!(typeDef.geteClass().getEStructuralFeature(fieldName) instanceof EReference)) {
					throw new QueryException(fieldName + " is not a reference");
				}
				feature = (EReference) typeDef.geteClass().getEStructuralFeature(fieldName);
			} else {
				if (feature != typeDef.geteClass().getEStructuralFeature(fieldName)) {
					throw new QueryException("Classes \"" + typeDef.geteClass().getName() + "\" and \"" + feature.getEContainingClass().getName() + "\" have fields with the same name, but they are not logically the same");
				}
			}
		}
		if (fields == null) {
			fields = new ArrayList<>();
		}
		fields.add(feature);
	}
801939
public static FieldAnnotation fromFieldDescriptor(FieldDescriptor fieldDescriptor) {
        return new FieldAnnotation(fieldDescriptor.getClassDescriptor().getDottedClassName(), fieldDescriptor.getName(),
                fieldDescriptor.getSignature(), fieldDescriptor.isStatic());
    }
88555
function createCheckDefaultValue(fieldDefinition, fieldName) {
  const defaultValue = fieldDefinition.defaultValue;

  // -----------------------------------------------------------------------
  // Set default value
  // -----------------------------------------------------------------------
  return function (content) {

    const valueToCheck = content[fieldName];
    // If the value is defined, we need to check it
    if (valueToCheck === undefined || valueToCheck === null) {
      if (defaultValue !== undefined) {
        content[fieldName] = defaultValue;
      }
    } else {
      if (Array.isArray(valueToCheck)) {
        valueToCheck.forEach(function (item, idx, arr) {
          if (item === undefined || item === null) {
            arr[idx] = defaultValue;
          }
        });
      }
    }
  };
}
697064
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        $fieldDef->fieldTypeConstraints->fieldSettings = new FieldSettings(
            [
                'hideRootTag' => (bool) $storageDef->dataInt3,
                'editView' => $storageDef->dataText1,
            ],
            FieldSettings::ARRAY_AS_PROPS
        );

        $fieldDef->fieldTypeConstraints->validators = [
            static::TAGS_VALIDATOR_IDENTIFIER => [
                'subTreeLimit' => (int) $storageDef->dataInt1,
                'maxTags' => (int) $storageDef->dataInt4,
            ],
        ];
    }
575095
public function addFieldDefinitionObject($identifier, $fieldDefinition)
    {
        $this->data['fields'][$identifier] = $this->convertToFieldDefintionObject($identifier, $fieldDefinition);
    }
797811
public function expandFieldDefinition(string $fieldName): void
    {
        $container = $this->context->findElement($this->getFieldDefinitionContainerLocator(sprintf($this::NEW_FIELD_TITLE_PATTERN, EzFieldElement::getFieldInternalNameByName($fieldName))));
        Assert::assertNotNull($container, sprintf('Definition for field %s not found', $fieldName));

        if (strpos($container->getAttribute('class'), $this->fields['fieldCollapsed']) !== false) {
            $container->find('css', $this->fields['fieldDefinitionToggler'])->click();
        }
    }
1087004
public boolean hasField(@NonNull String fieldName) {
      return ClassDescriptorCache.getInstance()
                                 .getClassDescriptor(clazz)
                                 .getFields(accessAll)
                                 .stream()
                                 .anyMatch(f -> f.getName().equals(fieldName));
   }
162213
public void addFieldDescriptor(FieldDescriptor fld)
    {
        fld.setClassDescriptor(this); // BRJ
        if (m_FieldDescriptions == null)
        {
            m_FieldDescriptions = new FieldDescriptor[1];
            m_FieldDescriptions[0] = fld;
        }
        else
        {
            int size = m_FieldDescriptions.length;
            FieldDescriptor[] tmpArray = new FieldDescriptor[size + 1];
            System.arraycopy(m_FieldDescriptions, 0, tmpArray, 0, size);
            tmpArray[size] = fld;
            m_FieldDescriptions = tmpArray;
            // 2. Sort fields according to their getOrder() Property
            Arrays.sort(m_FieldDescriptions, FieldDescriptor.getComparator());
        }

        m_fieldDescriptorNameMap = null;
        m_PkFieldDescriptors = null;
        m_nonPkFieldDescriptors = null;
        m_lockingFieldDescriptors = null;
        m_RwFieldDescriptors = null;
        m_RwNonPkFieldDescriptors = null;
    }
700268
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        $fieldDef->fieldTypeConstraints->fieldSettings = new FieldSettings(
            array(
                'defaultType' => $storageDef->dataInt1,
                'useSeconds' => (bool)$storageDef->dataInt2,
            )
        );

        // Building default value
        switch ($fieldDef->fieldTypeConstraints->fieldSettings['defaultType']) {
            case TimeType::DEFAULT_CURRENT_TIME:
                $dateTime = new DateTime();
                $data = $dateTime->getTimestamp() - $dateTime->setTime(0, 0, 0)->getTimestamp();
                break;
            default:
                $data = null;
        }

        $fieldDef->defaultValue->data = $data;
    }
685222
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
    {
        return array(
            new Search\Field(
                'file_name',
                $field->value->externalData['fileName'],
                new Search\FieldType\StringField()
            ),
            new Search\Field(
                'file_size',
                $field->value->externalData['fileSize'],
                new Search\FieldType\IntegerField()
            ),
            new Search\Field(
                'mime_type',
                $field->value->externalData['mimeType'],
                new Search\FieldType\StringField()
            ),
        );
    }
1316562
public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
    {
        if (isset($fieldDef->fieldTypeConstraints->fieldSettings['isMultiple'])) {
            $storageDef->dataInt1 = (int)$fieldDef->fieldTypeConstraints->fieldSettings['isMultiple'];
        }

        $storageDef->dataText5 = $fieldDef->defaultValue->data === null
            ? ''
            : implode(',', $fieldDef->defaultValue->data);
    }