Build the serialized form.

@throws DocletException if there is a problem while building the documentation
439069
@Override
    public void build() throws DocletException {
        SortedSet<TypeElement> rootclasses = new TreeSet<>(utils.makeGeneralPurposeComparator());
        rootclasses.addAll(configuration.getIncludedTypeElements());
        if (!serialClassFoundToDocument(rootclasses)) {
            //Nothing to document.
            return;
        }
        writer = configuration.getWriterFactory().getSerializedFormWriter();
        if (writer == null) {
            //Doclet does not support this output.
            return;
        }
        build(layoutParser.parseXML(NAME), contentTree);
    }
923307
private function build(): void
    {
        $prefix = "<?xml version='1.0' encoding='UTF-8'?>" . $this->glue() . "<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>";
        $suffix = '</feed>';

        $xml = collect($this->filters)->map(function ($items) {
            return $this->buildEntry($items);
        })->implode($this->glue());

        $this->xml = collect([$prefix, $xml, $suffix])->implode($this->glue());

        if ($this->writeFile) {
            $this->filesystem->dumpFile($this->outputFile, $this->xml);
        }
    }
722506
public function build()
    {
        $prevState = libxml_use_internal_errors(true);

        try {
            $doc = $this->buildDocument();

            if (!empty($this->schema) && !$doc->schemaValidate($this->schema)) {
                throw ReportDefinitionException::schemaValidation(libxml_get_errors());
            }

            if (false === $xml = $doc->saveXML()) {
                throw ReportDefinitionException::compileError(libxml_get_errors());
            }

            return $xml;
        } finally {
            libxml_clear_errors();
            libxml_use_internal_errors($prevState);
        }
    }
926984
public function build()
    {
        if (empty($this->groups)) {
            Throw new FormDesignerException('Your form has no groups to show. Add groups and try again.');
        }

        if (!$this->html->getId()) {
            Throw new FormDesignerException('There is no unique form id set. Each FormDesigner form needs it\'s unique id');
        }

        // Handle global container errors
        $this->handleGlobalContainerErrors();

        // Handle display mode
        $this->handleDisplayMode();

        // Control html container
        $html = '';

        // Create hidden field with unique session token
        if (!empty($this->token)) {
            $html .= '<input type="hidden" name="' . $this->token['name'] . '" value="' . $this->token['token'] . '">';
        }

        foreach ($this->groups as $group) {
            $html .= $this->buildGroup($group, [], $this->data, $this->errors);
        }

        $this->html->addInner($html);

        return $this->html->build();
    }
401414
public function build()
    {
        $this->isValidField($this->classMetadata, $this->fieldName);

        $this->classMetadata->appendExtension($this->getExtensionName(), [
            'slugs' => [
                $this->fieldName => $this->makeConfiguration(),
            ],
        ]);
    }
306016
protected function buildForm()
    {
        $this->formBuilder
            ->add(
                'host',
                'text',
                array(
                    'constraints' => array(
                        new NotBlank(),
                    ),
                )
            )
            ->add(
                'user',
                'text',
                array(
                    'constraints' => array(
                        new NotBlank(),
                    ),
                )
            )
            ->add(
                'password',
                'text',
                array(
                    'constraints' => array(
                        new NotBlank(),
                    ),
                )
            )
            ->add(
                'port',
                'text',
                array(
                    'constraints' => array(
                        new NotBlank(),
                        new GreaterThan(
                            array(
                                'value' => 0,
                            )
                        ),
                    ),
                )
            )
            ->add(
                'locale',
                'hidden',
                array(
                    'constraints' => array(
                        new NotBlank(),
                    ),
                )
            );
    }
182224
public function build(): SetDocumentContentRequest
	{
		$instance = new SetDocumentContentRequest();
		if ($this->frameId === null) {
			throw new BuilderException('Property [frameId] is required.');
		}
		$instance->frameId = $this->frameId;
		if ($this->html === null) {
			throw new BuilderException('Property [html] is required.');
		}
		$instance->html = $this->html;
		return $instance;
	}
763586
private function buildDocumentation() {
        $model = new Swagger\Model();
        $model->setId($this->getClassName());
        $this->buildProperties($model);
        foreach($this->getRelatedModels() as $alias => $relatedModel) {
            $this->buildProperties($model, $alias);
        }
        $resource = new Swagger\Resource();
        $resource->setApiVersion('1.0')->setBasePath('/v1.0')->setResourcePath($this->getClassName());
        $resource->setDescription('');
        $documentation = $model . "\n" . $resource;
        $this->getObject()->setDocumentation($documentation);
    }
397239
private function parseDocument()
    {
        $doc = $this->getDocument();
        if ($doc === null) {
            $this->isParsed = true;
            return;
        }

        $errors = new ErrorCollection();

        if (($data = $doc->getData()) === false) {
            // only single resource is supported in input
            $errors->addDataError("Invalid element");
            throw new JsonApiException($errors);
        }

        $schema        = $this->getSchema();
        $type          = $data->getType();
        $idx           = $data->getIdentifier();
        $attributes    =
            array_intersect_key($data->getAttributes(), $schema->getAttributesMap());

        if ($errors->count() > 0) {
            throw new JsonApiException($errors);
        }

        $this->type          = $type;
        $this->idx           = $idx;
        $this->resourceAttr  = $attributes;

        $this->validateParsed();

        $this->isParsed = true;
    }
33387
public function build()
    {
        if ($this->builded) {
            return;
        }

        $collection = $this->processFilter(false);

        $data = $collection->toArray();

        $this->prependRowSelectorColumn();
        $this->appendActionsColumn();

        Column::setOriginalGridModels($collection);

        $this->columns->map(function (Column $column) use (&$data) {
            $data = $column->fill($data);

            $this->columnNames[] = $column->getName();
        });

        $this->buildRows($data);

        $this->builded = true;
    }
898350
public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
    {
        if(isValidating()) {
            try {
                return new ValidatingDocumentBuilder(
                    _WrappedFactory.newDocumentBuilder(),
                    _Schema.newVerifier());
            } catch(VerifierConfigurationException ex) {
                throw new ParserConfigurationException(ex.getMessage());
            }
        } else
            //if validation is disabled, we simply return the implementation of wrapped DocumentBuilder
            return _WrappedFactory.newDocumentBuilder();
    }
528550
protected function buildStructuredHeaders(): void
    {
        $this->structuredHeaders = array();
        $headers = $this->entry[PoTokens::TRANSLATED];
        $headers = ($headers === null) ? array() : $headers;
        $full = implode('', $headers);
        $headers = explode("\n", $full);
        // split on ':'
        $pattern = '/([a-z0-9\-]+):\s*(.*)/i';
        foreach ($headers as $h) {
            if (preg_match($pattern, trim($h), $matches)) {
                $this->structuredHeaders[strtolower($matches[1])] = array(
                    'key' => $matches[1],
                    'value' => $matches[2],
                );
            }
        }
    }
657724
protected function build()
    {
        $operation = $this->buildOperation('TransactionStatus');

        $merchantID = $this->document->createElement('merchantID', $this->merchantId);
        $operation->appendChild($merchantID);

        if ($this->mpayTid) {
            $xmlMPayTid = $this->document->createElement('mpayTID', $this->mpayTid);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->tid) {
            $xmlTid = $this->document->createElement('tid', $this->tid);
            $operation->appendChild($xmlTid);
        }
    }
305311
static void initBuilder() {
		try {
			DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
			docBuilderFactory.setNamespaceAware(true);
			docBuilder = docBuilderFactory.newDocumentBuilder();
		} catch (ParserConfigurationException ex) {
			throw new RuntimeException(ex);
		}
	}
541402
public function getDocumentData()
    {
        // If the model contain a buildDocument function
        // use it to build the document
        if (method_exists($this, 'buildDocument')) {
            $document = $this->buildDocument();

            return $document;
        }
        // If a searchable array is provided build
        // the document from the given array
        elseif (is_array($this->searchable)) {
            $document = $this->buildDocumentFromArray($this->searchable);

            return $document;
        } else {
            $document = $this->toArray();

            return $document;
        }
    }
658311
protected function buildDictionary()
    {
        // Build dictionary.
        $this->dictionary = array();

        foreach ($this->objects as $id => $object) {
            $type = $object->getHeader()->get('Type')->getContent();

            if (!empty($type)) {
                $this->dictionary[$type][$id] = $id;
            }
        }
    }
833913
public function build()
    {
        if (empty($this->form)) {
            Throw new ControlException('Editbox control needs a set FormDesigner or Form object.');
        }

        // Editbox CSS class needed
        $this->panel->html->addCss('editbox');

        // Create panel heading with title
        $heading = $this->panel->createHeading();

        $title = $heading->createTitle();
        $title->setTitle($this->caption);

        if (! empty($this->description)) {
            $title->setDescription($this->description, true);
        }

        $heading->addContent($title);

        // Create panel body

        if ($this->form instanceof FormDesigner) {
            $form_id = $this->form->html->getId();
            $form_action = $this->form->html->getAttribute('action');

            // Ajax form?
            $this->is_ajax = $this->form->getSendMode() == 'ajax' ? true : false;
        }
        else {
            $form_id = $this->form->getId();
            $form_action = $this->form->getAttribute('action');
        }

        // Build form here because it's possible that form id will be autogenerated
        // and we need this id in the next step.
        $body = $this->panel->createBody();
        $body->addContent($this->form);

        // Footer with toolbar

        /* @var $toolbar \Core\Html\Bootstrap\Buttongroups\ButtonToolbar */
        $toolbar = $this->factory->create('Bootstrap\Buttongroups\ButtonToolbar');

        $create_action = function (Action $action, $with_link = false) {

            $text = $action->getText();
            $icon = $action->getIcon();

            if (! empty($icon)) {
                $text = $icon->build() . ' ' . $text;
            }

            if ($with_link) {

                $href = $action->getHref();

                if (! empty($href)) {

                    /* @var $a \Core\Html\Elements\A */
                    $a = $this->factory->create('Elements\A');

                    $a->setHref($href);

                    if ($action->getAjax()) {
                        $a->addData('ajax');
                    }

                    if ($action->getConfirm()) {
                        $a->addData('confirm', $action->getConfirm());
                    }

                    $a->setInner($text);

                    $text = $a->build();
                }
            }
            return $text;
        };

        // Make sure that he buttons have the correct order
        ksort($this->actions);

        foreach ($this->actions as $type => $action) {

            switch ($type) {
                case 0:
                case 1:

                    /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                    $group = $toolbar->createButtongroup();
                    $group->addCss('btn-group-sm');

                    switch ($type) {
                        case 0:

                            $button = $group->createButton();
                            $button->setFormId($form_id);
                            $button->setFormAction($form_action);
                            $button->isSuccess();

                            if ($this->is_ajax) {
                                $button->addData('ajax');
                            }
                            else {
                                $button->setType('submit');
                            }

                            break;

                        case 1:
                            $group->addCss('pull-right');

                            /* @var $button \Core\Html\Controls\UiButton */
                            $button = $group->createButton('Controls\UiButton');
                            $button->setHref($action->getHref());
                            $button->addCss('btn-danger');

                            if ($this->is_ajax) {
                                $button->addData('ajax');
                            }
                            break;
                    }

                    $button->setInner($create_action($this->actions[$type]));

                    break;

                case 2:
                default:

                    /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                    $group = $toolbar->createButtongroup();
                    $group->addCss('btn-group-sm pull-right dropup');

                    /* @var $context_menu \Core\Html\Form\Button */
                    $context_menu = $this->factory->create('Bootstrap\Button\Button');
                    $context_menu->addCss('dropdown-toggle');
                    $context_menu->addAria([
                        'haspopup' => "true",
                        'expanded' => "false"
                    ]);
                    $context_menu->addData('toggle', 'dropdown');

                    // Do we have a text to show on actions button?
                    if (! empty($this->context_text)) {
                        $context_menu->addInner($this->context_text . ' ');
                    }

                    $context_menu->addInner('<span class="caret"></span>');

                    $group->setInner($context_menu->build());

                    // Create the actions dropdown menu
                    $dropdown = '<ul class="dropdown-menu">';

                    foreach ($this->actions[$type] as $action) {
                        $dropdown .= '<li>' . $create_action($action, true) . '</li>';
                    }

                    $dropdown .= '</ul>';

                    $group->addInner($dropdown);

                    break;
            }
        }

        $footer = $this->panel->createFooter();
        $footer->addContent($toolbar);

        return $this->panel->build();
    }