@param AbstractField|Group|Fieldset $element

@return bool
763016
private function getDefaultValue($element)
    {
        if (!$name = $element->getName()) {
            return false;
        }

        if (is_null($element->getValue())) {
            return false;
        }

        $userInput = $element->getValue();

        list($valid, $elementValue) = $this->validateValue($element, $userInput);
        $this->storeValue($name, $valid, $userInput, $elementValue);

        return true;
    }
1081565
public function addField(Element\AbstractElement $field)
    {
        if (!isset($this->fields[$this->current])) {
            $this->fields[$this->current] = [];
        }
        $this->fields[$this->current][$field->getName()] = $field;
        return $this;
    }
912750
private function getFields($field)
    {
        if ($field instanceof Group || $field instanceof Fieldset) {
            $elements = $field->getFields();
        } elseif ($field instanceof AbstractField) {
            $elements = [$field];
        } else {
            throw new \InvalidArgumentException(sprintf(
                "Invalid type '%s'",
                is_object($field) ? get_class($field) : gettype($field)
            ));
        }

        return $elements;
    }
22809
protected function _getInheritCheckboxLabel(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        $checkboxLabel = __('Use Default');
        if ($element->getCanUseContainerValue()) {
            $checkboxLabel = __('Use Container');
        }

        return $checkboxLabel;
    }
1106989
public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        $url = $this->escapeUrl($this->_urlBuilder->getUrl('dotdigitalgroup_email/run/catalogsync'));

        return $this->getLayout()
            ->createBlock(\Magento\Backend\Block\Widget\Button::class)
            ->setType('button')
            ->setLabel($this->buttonLabel)
            ->setOnClick("window.location.href='" . $url . "'")
            ->toHtml();
    }
1210130
public function isSingleton(string $abstract) : bool
    {
        if (! $this->has($abstract)) {
            throw new NotFoundException("Element '$abstract' not found");
        }

        return $this->collection[$abstract] instanceof Closure === false;
    }
668280
public function _getElementHtml(
        \Magento\Framework\Data\Form\Element\AbstractElement $element
    ) {
        //base url
        $baseUrl = $this->dataHelper->generateDynamicUrl();
        //config passcode
        $passcode = $this->dataHelper->getPasscode();
        //last order id for dynamic page
        $lastOrderId = $this->dataHelper->getLastOrderId();

        if (empty($passcode)) {
            $passcode = '[PLEASE SET UP A PASSCODE]';
        }
        //alert message for last order id is not mapped
        if (!$lastOrderId) {
            $lastOrderId = '[PLEASE MAP THE LAST ORDER ID]';
        }

        //full url for dynamic content
        $text = sprintf(
            '%sconnector/product/crosssell/code/%s/order_id/@%s@',
            $baseUrl,
            $passcode,
            $lastOrderId
        );
        $element->setData('value', $text);

        return parent::_getElementHtml($element);
    }
725833
public function deleteElement($key, $element)
    {
        $cache = $this->get($key);
        if ($cache !== false && isset($cache[$element])) {
            unset($cache[$element]);
            return $this->set($key, $cache);
        }
        return true;
    }
1071571
private function getFieldElement($element)
    {
        $element = $this->getElement($element);
        while (null !== $element && !$element->hasClass('field')) {
            $element = $element->getParent();
        }

        return $element;
    }
119846
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        if ($this->getValues()) {
            $element->setValue($this->getValues());
        }

        $this->setElement($element);

        return $this->toHtml();
    }
418258
public function removeElement(AbstractElement $element)
	{
		$id = $element->getId();

		if (!isset($this->elements[$id])) {
			throw new MissingElementException("Element \"$id\" is not indexed.");
		}

		unset($this->elements[$id]);

		$indexedAttrs = array_intersect_key($element->getAttributes(), $this->index);
		foreach ($indexedAttrs as $key => $oldValue) {
			unset($this->index[$key][$oldValue][$id]);
		}
	}
64616
public function hydrateAdd($element)
    {
        $this->collection->add($element);

        // If _backRefFieldName is set and its a one-to-many association,
        // we need to set the back reference.
        if ($this->backRefFieldName && $this->association instanceof OneToManyAssociationMetadata) {
            $inversedAssociation = $this->typeClass->getProperty($this->backRefFieldName);

            // Set back reference to owner
            $inversedAssociation->setValue($element, $this->owner);

            $this->em->getUnitOfWork()->setOriginalEntityProperty(
                spl_object_id($element),
                $this->backRefFieldName,
                $this->owner
            );
        }
    }
121625
public function shouldParseElementOnMove(Element $element): bool
    {
        $fieldLayout = $element->getFieldLayout();

        if ($fieldLayout) {
            foreach ($fieldLayout->getFields() as $field) {
                if ($field && \get_class($field) === 'aelvan\preparsefield\fields\PreparseFieldType') {
                    /** @var PreparseFieldType $field */
                    $parseOnMove = $field->parseOnMove;

                    if ($parseOnMove) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
1135876
protected function isProcessableElement($element)
    {
        return ($element instanceof Form) && (!is_a($element->getConfig()->getType(), HiddenType::class, true));
    }
579878
public function afterElementDelete (ElementInterface $element)
	{
		SimpleMap::getInstance()->map->softDeleteField($this, $element);
		parent::afterElementDelete($element);
	}
490915
public function getPreviousSiblingOf( AbstractElement $element ) {
		$index = $this->indexOf($element);

		return $this->childAtIndex($index - 1);
	}
1062036
protected function serializeElement($element)
	{
		return (is_array($element)) ? $this->serializeStrings($element) : $this->serializeLiteral($element);
	}