Handlers for all elements.

@param array $Element

@return string
16856
protected function element(array $Element)
    {
        $markup = '';

        if (str_is('h[1-6]', $Element['name'])) {
            $link = str_replace(' ', '-', strtolower($Element['text']));
            $markup = '<a  class="header-link" href="#'.$link.'" id="'.$link.'"><i class="glyphicon glyphicon-link"></i></a>';
        }

        $markup .= parent::element($Element);

        return $markup;
    }
682366
public static function getDebugTag( $element ) {
		if ( !$element ) {
			return '';
		} elseif ( $element instanceof Element || $element instanceof SerializerNode ) {
			return $element->getDebugTag();
		} else {
			return get_class( $element ) . '#' . substr( md5( spl_object_hash( $element ) ), 0, 8 );
		}
	}
1338368
private function elementAttr(string $element) : string
    {
        if (in_array($element, $this->elements) === true) {
            $attr = '';

            if (count($this->attr[$element]) > 0) {
                $attr = ' style="' . implode(' ', $this->attr[$element]) . '"';
            }

            return $attr;
        } else {
            return '';
        }
    }
1062036
protected function serializeElement($element)
	{
		return (is_array($element)) ? $this->serializeStrings($element) : $this->serializeLiteral($element);
	}
120366
public function resolveElement(Element $element)
    {
        $elementtype = $this->elementService->findElementtype($element);

        return $this->resolveElementtype($elementtype);
    }
1216297
private function renderElementAsRow(Element $element) : string
    {
        $tr = new Tag('tr');

        $html = $this->renderCell('th', $element->getLabel()->render() . $this->renderErrors($element));
        $html .= $this->renderCell('td', $element->render());

        $tr->setHtmlContent($html);

        return $tr->render();
    }
292633
protected function getEdges($element)
    {
        // TODO: Performance tuning possible here by not looping

        foreach ($this->options["tags"] as $tag) {
            list($opening, $closing, $depth) = $tag;

            if (substr($element, 0, strlen($opening)) === $opening
                && substr($element, -1 * strlen($closing)) === $closing) {

                return $tag;
            }
        }
    }
368267
private function renderElement(Element $element) : string
    {
        $label = $element->getLabel();

        if ($label->isEmpty()) {
            return $element->render();
        }

        return $label->render() . $element->render();
    }
438472
private function replaceInsertTag(array $elements): string
    {
        if (3 !== \count($elements)) {
            return '';
        }

        list($source, $value, $property) = $elements;

        $tag = $this->registry->get($source)->find($value);

        if (null === $tag) {
            return '';
        }

        if ('name' === $property) {
            return $tag->getName();
        }

        $data = $tag->getData();

        return isset($data[$property]) ? (string) $data[$property] : '';
    }
403033
private function filterElements(array $elements): array
    {
        $filteredElements = [];

        foreach ($elements as $element) {
            if (!$this->elementExcluder->isExcluded($element) && $this->hasUrlAttribute($element)) {
                $filteredElements[] = $element;
            }
        }

        return $filteredElements;
    }
183551
public function transform(array $element)
    {
        // argument: [name, mode, description, default]
        // option: [name, shortcut, mode, description, default]

        $isArgument = $this->isArgument($element[0]);

        $class = 'Symfony\Component\Console\Input\Input'.($isArgument ? 'Argument' : 'Option');

        $reflector = new \ReflectionClass($class);

        if ($isArgument)
        {
            $element[1] = $this->transformMode($element[1]);
        }
        else
        {
            $element[2] = $this->transformMode($element[2]);
        }

        $element[0] = $this->cleanName($element[0]);

        return $reflector->newInstanceArgs($element);
    }
682370
public static function process(array $element, FormStateInterface $form_state) {
    $element['fid'] = [
      '#type' => 'hidden',
    ];
    $element['upload'] = $element['remove'] = [
      '#type' => 'submit',
      '#is_button' => TRUE,
      '#limit_validation_errors' => [
        $element['#parents'],
      ],
      '#weight' => 100,
    ];

    $element['upload']['#value'] = t('Upload');
    $element['upload']['#submit'][] = [static::class, 'upload'];

    $element['remove']['#value'] = t('Remove');
    $element['remove']['#submit'][] = [static::class, 'remove'];

    $key = array_merge($element['#parents'], ['fid']);
    // Don't use $form_state->hasValue(), because it will return TRUE if the
    // value exists and is falsy. Valid file IDs will always be truthy.
    $fid = $form_state->getValue($key);

    if ($fid) {
      $element['fid']['#value'] = $fid;

      $element['file'] = [
        '#theme' => 'file_link',
        '#file' => File::load($fid),
      ];
      $element['upload']['#access'] = FALSE;
    }
    else {
      $element['file'] = [
        '#type' => 'upload',
        '#title' => $element['#title'],
        '#upload_location' => $element['#upload_location'],
        '#upload_validators' => $element['#upload_validators'],
      ];
      $element['remove']['#access'] = FALSE;
    }
    return $element;
  }
874219
public function addElement($element){

        $elements = $this->formElements;
        $elements[] = $element;

        $this->formElements = $elements;

        return $this;
    }
158289
public static function prep_element($element) {
		if (self::containsCode($element)===false) {
			$element='"'.addslashes($element).'"';
		}
		return $element;
	}
47135
public static function parseElement($element)
    {
        if ($element->getName() == "rowset") {
            $re = new RowSet($element);
        } elseif ($element->getName() == "result" && $element->member) { // corp/MemberSecurity workaround
            $container = new Container();
            $container->addElement('members', new PhealRowSet($element, 'members', 'member'));
            $re = new Element('result', $container);
        } else {
            $key = $element->getName();
            $echilds = $element->children();
            if (count($echilds) > 0) {
                $container = new Container();
                foreach ($echilds as $celement) {
                    $cel = Element::parseElement($celement);
                    if (count($celement->attributes()) > 0) {
                        $container->addElement($cel->_name, $cel);
                    } else {
                        $container->addElement($cel->_name, $cel->_value);
                    }
                }
                $value = $container;
            } else {
                $value = (String)$element;
            }

            $re = new Element($key, $value);
            /** @var $element \SimpleXMLElement */
            if (count($element->attributes()) > 0) {
                foreach ($element->attributes() as $name => $attelem) {
                    $re->addAttrib($name, (String)$attelem);
                }
            }

        }
        return $re;
    }
167157
public function pushScalar(array $element) {
        if(!empty($element['required'])) {
            $this->hasRequired = true;
        }
        if(empty($this->containers)) {
            $this->array += $element;
        } else {
            $this->containers[count($this->containers) - 1][\Illuminate\Support\Arr::get($element, 'id')] = $element;
        }
    }
1143677
protected function _singleElement($element, $attributes = [])
    {
        $perm = $this->settings['attr']['perm'] ?? NULL;

        $this->outputElement .= $this->_perm($perm, '<'.strtolower($element).$this->attributes($attributes).'>');

        return $this;
    }