Marshall a Br object into a DOMElement object.

@param \qtism\data\QtiComponent $component A Br object.
@return \DOMElement The according DOMElement object.
@throws \qtism\data\storage\xml\marshalling\MarshallingException
343040
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement('br');

        if ($component->hasXmlBase() === true) {
            self::setXmlBase($element, $component->setXmlBase());
        }

        $this->fillElement($element, $component);

        return $element;
    }
187941
public static XContentBuilder marshall(RoleMembershipBean bean) throws StorageException {
        try (XContentBuilder builder = XContentFactory.jsonBuilder()) {
            preMarshall(bean);
            builder
                .startObject()
                    .field("id", bean.getId())
                    .field("organizationId", bean.getOrganizationId())
                    .field("roleId", bean.getRoleId())
                    .field("userId", bean.getUserId())
                    .field("createdOn", bean.getCreatedOn().getTime())
                .endObject();
            postMarshall(bean);
            return builder;
        } catch (IOException e) {
            throw new StorageException(e);
        }
    }
681026
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $this->setDOMElementAttribute($element, 'sourceValue', $component->getSourceValue());
        $this->setDOMElementAttribute($element, 'targetValue', $component->getTargetValue());

        return $element;
    }
71497
protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);
        $version = $this->getVersion();
        
        if ($component->isParamVariable() === true) {
            $this->setDOMElementAttribute($element, 'paramVariable', true);
        } elseif (Version::compare($version, '2.0.0', '==') === true && $component->isParamVariable() === false) {
            $this->setDOMElementAttribute($element, 'paramVariable', false);
        }

        if ($component->isMathVariable() === true) {
            $this->setDOMElementAttribute($element, 'mathVariable', true);
        } elseif (Version::compare($version, '2.0.0', '==') === true && $component->isMathVariable() === false) {
            $this->setDOMElementAttribute($element, 'mathVariable', false);
        }

        return $element;
    }
1186892
protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);
        $this->setDOMElementAttribute($element, 'outcomeIdentifier', $component->getOutcomeIdentifier());

        $weightIdentifier = $component->getWeightIdentifier();
        if (!empty($weightIdentifier)) {
            $this->setDOMElementAttribute($element, 'weightIdentifier', $weightIdentifier);
        }

        return $element;
    }
43461
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement('col');

        if ($component->getSpan() !== 1) {
            $this->setDOMElementAttribute($element, 'span', $component->getSpan());
        }

        $this->fillElement($element, $component);

        return $element;
    }
221365
public function addComponent(Component $component)
	{
		$component->setParentComponent($this);
		$component->setFormComponent($this->formComponent);
		
		$this->components[$component->getName()] = $component;
		
		// Set value if there is one
		$component->setRequestData(is_array($this->inputData) && array_key_exists($component->getName(), $this->inputData) ? $this->inputData[$component->getName()] : null);
	}
467523
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier());

        $weightIdentifier = $component->getWeightIdentifier();
        if (!empty($weightIdentifier)) {
            $this->setDOMElementAttribute($element, 'weightIdentifier', $weightIdentifier);
        }

        return $element;
    }
460781
public function set_component($component) {
        $this->areacache = null;
        list($type, $name) = core_component::normalize_component($component);
        $this->component = $type.'_'.$name;
    }
1374251
public function add(HtmlComponent $component)
    {
        if (isset($this->components[$component->id])) {
            throw new ZE(sprintf(ERROR_COMPONENT_ALREADY_EXISTS, $component->id, $this->id));
        }
        if (property_exists($this, $component->id)) {
            $id = strlen($this->id) > 0 ? $this->id : get_class($this);
            throw new ZE(sprintf(ERROR_COMPONENT_AS_PROPERTY, $component->id, $id));
        }

        $this->components[$component->id] = $component;
        $component->setOwner($this);
        $component->onAdded();
        return $component;
    }
199589
protected function marshall(QtiComponent $component)
    {
        $element = $this->createElement($component);
        $this->fillElement($element, $component);
        $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier());
        $this->setDOMElementAttribute($element, 'lowerBound', $component->getLowerBound());
        $this->setDOMElementAttribute($element, 'upperBound', $component->getUpperBound());

        if ($component->hasStep() === true) {
            $this->setDOMElementAttribute($element, 'step', $component->getStep());
        }

        if ($component->mustStepLabel() === true) {
            $this->setDOMElementAttribute($element, 'stepLabel', true);
        }

        if ($component->getOrientation() === Orientation::VERTICAL) {
            $this->setDOMElementAttribute($element, 'orientation', Orientation::getNameByConstant(Orientation::VERTICAL));
        }

        if ($component->mustReverse() === true) {
            $this->setDOMElementAttribute($element, 'reverse', true);
        }

        if ($component->hasXmlBase() === true) {
            self::setXmlBase($element, $component->getXmlBase());
        }

        if ($component->hasPrompt() === true) {
            $element->appendChild($this->getMarshallerFactory()->createMarshaller($component->getPrompt())->marshall($component->getPrompt()));
        }

        return $element;
    }
887038
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $this->setDOMElementAttribute($element, 'sourceIdentifier', $component->getSource());
        $this->setDOMElementAttribute($element, 'targetIdentifier', $component->getTarget());

        return $element;
    }
1062538
protected function unmarshall(DOMElement $element)
    {
        $mapEntriesElts = $this->getChildElementsByTagName($element, 'mapEntry');
        $mapEntries = new MapEntryCollection();

        foreach ($mapEntriesElts as $mapEntryElt) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEntryElt, array($this->getBaseType()));
            $mapEntries[] = $marshaller->unmarshall($mapEntryElt);
        }

        try {
            $object = new Mapping($mapEntries);

            if (($defaultValue = $this->getDOMElementAttributeAs($element, 'defaultValue', 'float')) !== null) {
                $object->setDefaultValue($defaultValue);
            }

            if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) {
                $object->setLowerBound($lowerBound);
            }

            if (($upperBound = $this->getDOMElementAttributeAs($element, 'upperBound', 'float')) !== null) {
                $object->setUpperBound($upperBound);
            }

            return $object;
        } catch (InvalidArgumentException $e) {
            $msg = "A 'mapping' element must contain at least one 'mapEntry' element. None found";
            throw new UnmarshallingException($msg, $element, $e);
        }
    }
346592
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier());
        $this->setDOMElementAttribute($element, 'title', $component->getTitle());
        $this->setDOMElementAttribute($element, 'timeDependent', $component->isTimeDependent());
        $this->setDOMElementAttribute($element, 'adaptive', $component->isAdaptive());

        if ($component->hasLang() === true) {
            $this->setDOMElementAttribute($element, 'lang', $component->getLang());
        }

        if ($component->hasLabel() === true) {
            $this->setDOMElementAttribute($element, 'label', $component->getLabel());
        }

        if ($component->hasToolName() === true) {
            $this->setDOMElementAttribute($element, 'toolName', $component->getToolName());
        }

        if ($component->hasToolVersion() === true) {
            $this->setDOMElementAttribute($element, 'toolVersion', $component->getToolVersion());
        }

        foreach ($component->getResponseDeclarations() as $responseDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseDeclaration);
            $element->appendChild($marshaller->marshall($responseDeclaration));
        }

        foreach ($component->getOutcomeDeclarations() as $outcomeDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeDeclaration);
            $element->appendChild($marshaller->marshall($outcomeDeclaration));
        }

        foreach ($component->getTemplateDeclarations() as $templateDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($templateDeclaration);
            $element->appendChild($marshaller->marshall($templateDeclaration));
        }

        if ($component->hasTemplateProcessing() === true) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getTemplateProcessing());
            $element->appendChild($marshaller->marshall($component->getTemplateProcessing()));
        }

        foreach ($component->getStylesheets() as $stylesheet) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($stylesheet);
            $element->appendChild($marshaller->marshall($stylesheet));
        }

        if ($component->hasItemBody() === true) {
            $itemBody = $component->getItemBody();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($itemBody);
            $element->appendChild($marshaller->marshall($itemBody));
        }

        if ($component->hasResponseProcessing() === true) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getResponseProcessing());
            $element->appendChild($marshaller->marshall($component->getResponseProcessing()));
        }

        foreach ($component->getModalFeedbacks() as $modalFeedback) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($modalFeedback);
            $element->appendChild($marshaller->marshall($modalFeedback));
        }

        return $element;
    }
625782
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $this->setDOMElementAttribute($element, 'name', MathEnumeration::getNameByConstant($component->getName()));

        return $element;
    }
439175
private function setRootComponent( common_configuration_Component $component)
    {
        
        $this->rootComponent = $component;
        $components = $this->getComponents();
        $components[] = $component;
        $this->setComponents($components);
        $this->silent($component);
        
    }
470613
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        if ($component->hasLowerBound() === true) {
            $this->setDOMElementAttribute($element, 'lowerBound', $component->getLowerBound());
        }

        if ($component->hasUpperBound() === true) {
            $this->setDOMElementAttribute($element, 'upperBound', $component->getUpperBound());
        }

        $this->setDOMElementAttribute($element, 'defaultValue', $component->getDefaultValue());

        foreach ($component->getMapEntries() as $mapEntry) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEntry, array($this->getBaseType()));
            $element->appendChild($marshaller->marshall($mapEntry));
        }

        return $element;
    }