@param GenericDeserializationVisitor $visitor
@param string                        $contentAttributeValue
@param array                         $type
@param Context                       $context

@return null|string
507263
public function deserializeFieldType(GenericDeserializationVisitor $visitor, $contentAttributeValue, array $type, Context $context)
    {
        $facade = $visitor->getCurrentObject();
        if ($facade instanceof ContentAttributeFacade && null !== $facade->type) {
            if (isset($this->fieldTypes[$facade->type]) &&
                isset($this->fieldTypes[$facade->type]['deserialize_type'])
            ) {
                if ($this->fieldTypes[$facade->type]['deserialize_type'] == 'array' && is_scalar($contentAttributeValue)) {
                    $contentAttributeValue = array($contentAttributeValue);
                }

                return $visitor->getNavigator()->accept($contentAttributeValue, array('name' => $this->fieldTypes[$facade->type]['deserialize_type'], 'params' => array()), $context);
            }
        }

        return null;
    }
23006
public final Object getValue(Bindings bindings, ELContext context, Class<?> type) {
		Object value = eval(bindings, context);
		if (type != null) {
			value = bindings.convert(value, type);
		}
		return value;
	}
1110422
public function serializeElastificationSource(
        JsonDeserializationVisitor $visitor,
        $data,
        array $type,
        Context $context
    ) {
        $this->sourceDeSerClass = empty($this->sourceDeSerClass) ? $type['name'] : $this->sourceDeSerClass;

        return $visitor->getNavigator()->accept($data, ['name' => $this->sourceDeSerClass], $context);
    }
726582
public function getAttribute($type)
    {
        $value = null;

        if (is_array($this->attributesReceived)) {
            foreach($this->attributesReceived as $attr) {
                if (intval($type) == $attr[0]) {
                    $value = $attr[1];
                    break;
                }
            }
        }

        return $value;
    }
1334334
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $contentType = $data->contentType;

        $urlTypeSuffix = $this->getUrlTypeSuffix($contentType->status);
        $mediaType = $data->fieldDefinitions !== null ? 'ContentType' : 'ContentTypeInfo';

        $generator->startObjectElement($mediaType);

        $visitor->setHeader('Content-Type', $generator->getMediaType($mediaType));

        if ($contentType->status === APIContentType::STATUS_DRAFT) {
            $visitor->setHeader('Accept-Patch', $generator->getMediaType('ContentTypeUpdate'));
        }

        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadContentType' . $urlTypeSuffix,
                array(
                    'contentTypeId' => $contentType->id,
                )
            )
        );
        $generator->endAttribute('href');

        $generator->startValueElement('id', $contentType->id);
        $generator->endValueElement('id');

        $generator->startValueElement('status', $this->serializeStatus($contentType->status));
        $generator->endValueElement('status');

        $generator->startValueElement('identifier', $contentType->identifier);
        $generator->endValueElement('identifier');

        $this->visitNamesList($generator, $contentType->getNames());

        $descriptions = $contentType->getDescriptions();
        if (is_array($descriptions)) {
            $this->visitDescriptionsList($generator, $descriptions);
        }

        $generator->startValueElement('creationDate', $contentType->creationDate->format('c'));
        $generator->endValueElement('creationDate');

        $generator->startValueElement('modificationDate', $contentType->modificationDate->format('c'));
        $generator->endValueElement('modificationDate');

        $generator->startObjectElement('Creator', 'User');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadUser',
                array('userId' => $contentType->creatorId)
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Creator');

        $generator->startObjectElement('Modifier', 'User');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadUser',
                array('userId' => $contentType->modifierId)
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Modifier');

        $generator->startObjectElement('Groups', 'ContentTypeGroupRefList');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadGroupsOfContentType',
                array('contentTypeId' => $contentType->id)
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Groups');

        $generator->startObjectElement('Draft', 'ContentType');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadContentTypeDraft',
                array('contentTypeId' => $contentType->id)
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Draft');

        $generator->startValueElement('remoteId', $contentType->remoteId);
        $generator->endValueElement('remoteId');

        $generator->startValueElement('urlAliasSchema', $contentType->urlAliasSchema);
        $generator->endValueElement('urlAliasSchema');

        $generator->startValueElement('nameSchema', $contentType->nameSchema);
        $generator->endValueElement('nameSchema');

        $generator->startValueElement(
            'isContainer',
            $this->serializeBool($generator, $contentType->isContainer)
        );
        $generator->endValueElement('isContainer');

        $generator->startValueElement('mainLanguageCode', $contentType->mainLanguageCode);
        $generator->endValueElement('mainLanguageCode');

        $generator->startValueElement(
            'defaultAlwaysAvailable',
            $this->serializeBool($generator, $contentType->defaultAlwaysAvailable)
        );
        $generator->endValueElement('defaultAlwaysAvailable');

        $generator->startValueElement('defaultSortField', $this->serializeSortField($contentType->defaultSortField));
        $generator->endValueElement('defaultSortField');

        $generator->startValueElement('defaultSortOrder', $this->serializeSortOrder($contentType->defaultSortOrder));
        $generator->endValueElement('defaultSortOrder');

        if ($data->fieldDefinitions !== null) {
            $visitor->visitValueObject(
                new Values\FieldDefinitionList(
                    $contentType,
                    $data->fieldDefinitions
                )
            );
        }

        $generator->endObjectElement($mediaType);
    }
684045
public function serializeRepositoryFilter(VisitorInterface $visitor, RepositoryFilterInterface $repositoryFilter, array $type, Context $context)
    {
        return $visitor->visitArray(iterator_to_array($repositoryFilter), $type, $context);
    }
574028
public function deserialize(VisitorInterface $visitor, $data, Type $type, Context $context): ?UuidInterface
    {
        if (empty($data)) {
            return $visitor->visitNull(null, Type::null(), $context);
        }

        return Uuid::fromString($data);
    }
307927
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $generator->startObjectElement('ObjectState');
        $visitor->setHeader('Content-Type', $generator->getMediaType('ObjectState'));
        $visitor->setHeader('Accept-Patch', $generator->getMediaType('ObjectStateUpdate'));

        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadObjectState',
                array('objectStateGroupId' => $data->groupId, 'objectStateId' => $data->objectState->id)
            )
        );
        $generator->endAttribute('href');

        $generator->startValueElement('id', $data->objectState->id);
        $generator->endValueElement('id');

        $generator->startValueElement('identifier', $data->objectState->identifier);
        $generator->endValueElement('identifier');

        $generator->startValueElement('priority', $data->objectState->priority);
        $generator->endValueElement('priority');

        $generator->startObjectElement('ObjectStateGroup');

        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadObjectStateGroup', array('objectStateGroupId' => $data->groupId))
        );
        $generator->endAttribute('href');

        $generator->endObjectElement('ObjectStateGroup');

        $generator->startValueElement('defaultLanguageCode', $data->objectState->defaultLanguageCode);
        $generator->endValueElement('defaultLanguageCode');

        $generator->startValueElement('languageCodes', implode(',', $data->objectState->languageCodes));
        $generator->endValueElement('languageCodes');

        $this->visitNamesList($generator, $data->objectState->getNames());
        $this->visitDescriptionsList($generator, $data->objectState->getDescriptions());

        $generator->endObjectElement('ObjectState');
    }
365643
public function traverse($data, SchemaInterface $schema, VisitorInterface $visitor = null)
    {
        $this->pathStack = [];
        $this->recCount  = -1;
        
        if ($visitor === null) {
            $visitor = new NullVisitor();
        }

        return $this->recTraverse($data, $schema->getDefinition(), $visitor);
    }
1369320
public function serializeDateTimeImmutable(
        SerializationVisitorInterface $visitor,
        \DateTimeImmutable $date,
        array $type,
        SerializationContext $context
    ) {
        return $this->serializeDateTimeInterface($visitor, $date, $type, $context);
    }
975730
public function convertFromMongoFormatToDateTime(VisitorInterface $visitor, $date, array $type, Context $context)
    {
        /**
         * this $dateTime object is incorrect in case of using microseconds
         * because after conversion of \MongoDB\BSON\UTCDateTime to \DateTime
         * method $dateTime->format('U.u') returns invalid string xxxxxxxxx.zzzzzzzzz
         * part after "." contains 9 digits but it should contain up to 6 digits
         * so we have to reduce this part to 6 digits.
         *
         * @var \DateTime
         */
        if (!is_string($date) && !$date instanceof UTCDatetime) {
            throw new \InvalidArgumentException('The provided date must be a valid string or an instance of UTCDateTime');
        }

        if (is_string($date)) {
            $dateTime = date_create($date);
            if (false === $dateTime) {
                throw new \InvalidArgumentException(sprintf('The provided date "%s" is not a valid date/time string', $date));
            }

            return $dateTime;
        }

        return self::convertMongoFormatToDateTime($date);
    }
1226021
public function create(array $visitorRawData = array())
    {
        $visitor = null;

        /**
         * Triggered while visit is filtering in live plugin. Subscribers to this
         * event can force the use of a custom visitor object that extends from
         * {@link Piwik\Plugins\Live\VisitorInterface}.
         *
         * @param \Piwik\Plugins\Live\VisitorInterface &$visitor Initialized to null, but can be set to
         *                                              a new visitor object. If it isn't modified
         *                                              Piwik uses the default class.
         * @param array $visitorRawData Raw data using in Visitor object constructor.
         */
        Piwik::postEvent('Live.makeNewVisitorObject', array(&$visitor, $visitorRawData));

        if (is_null($visitor)) {
            $visitor = new Visitor($visitorRawData);
        } elseif (!($visitor instanceof VisitorInterface)) {
            throw new Exception("The Visitor object set in the plugin must implement VisitorInterface");
        }

        return $visitor;
    }
1110373
public void callChildVisitors(XSLTVisitor visitor, boolean callAttrs)
  {
  	if(callAttrs)
  	{
	  	if(null != m_countMatchPattern)
	  		m_countMatchPattern.getExpression().callVisitors(m_countMatchPattern, visitor);
	  	if(null != m_fromMatchPattern)
	  		m_fromMatchPattern.getExpression().callVisitors(m_fromMatchPattern, visitor);
	  	if(null != m_valueExpr)
	  		m_valueExpr.getExpression().callVisitors(m_valueExpr, visitor);
	
	  	if(null != m_format_avt)
	  		m_format_avt.callVisitors(visitor);
	  	if(null != m_groupingSeparator_avt)
	  		m_groupingSeparator_avt.callVisitors(visitor);
	  	if(null != m_groupingSize_avt)
	  		m_groupingSize_avt.callVisitors(visitor);
	  	if(null != m_lang_avt)
	  		m_lang_avt.callVisitors(visitor);
	  	if(null != m_lettervalue_avt)
	  		m_lettervalue_avt.callVisitors(visitor);
  	}

    super.callChildVisitors(visitor, callAttrs);
  }
1216330
public function create($contentOrName, $type = null, array $data = [])
    {
        // Check if container or name is defined
        if (!(
            $contentOrName instanceof Model\ContentInterface ||
            (is_string($contentOrName) && 0 < strlen($contentOrName))
        )
        ) {
            throw new InvalidOperationException("Excepted instance of ContentInterface or string.");
        }

        // Default type if null
        if (null === $type) {
            $type = $this->defaultType;
        }

        // New instance
        $container = $this->editor->getRepository()->createContainer();
        $container->setType($type);

        // Plugin creation
        $plugin = $this->editor->getContainerPlugin($type);
        $plugin->create($container, $data);

        // Create default row
        if (!$plugin instanceof CopyPlugin) {
            $this->editor->getRowManager()->create($container);
        }

        // Add to container if available
        if ($contentOrName instanceof Model\ContentInterface) {
            $count = $contentOrName->getContainers()->count();
            $container->setPosition($count);
            $contentOrName->addContainer($container);
        } else {
            $container->setName($contentOrName);
        }

        return $container;
    }
1214857
public function serializeSchemaTypeToJson(
        JsonSerializationVisitor $visitor,
        SchemaType $schemaType,
        array $type,
        Context $context
    ) {
        $types = $schemaType->getTypes();

        if (count($types) === 1) {
            return array_pop($types);
        }

        return $types;
    }
1097365
public function setMeta($type = 'name', $typeValue = '', $content = '', array $modifiers = [])
    {
        if (!in_array($type, ['name', 'http-equiv', 'charset', 'property'])) {
            throw new \InvalidArgumentException(sprintf('Invalid meta type "%s"', $type));
        }

        $modifiersString = '';
        foreach ($modifiers as $key => $value) {
            if (!in_array($key, ['lang', 'scheme'])) {
                continue;
            }
            if ($this->doctype == self::DOCTYPE_HTML5 && $key == 'scheme') {
                throw new \InvalidArgumentException('Modifier "scheme" not supported by HTML5');
            }

            $modifiersString .= $key . '="' . $value . '" ';
        }
        if (!empty($modifiersString)) {
            $modifiersString = ' ' . rtrim($modifiersString);
        }

        if ($this->doctype == self::DOCTYPE_HTML5 && $type == 'charset') {
            $html = '<meta %s="%s">';
        } elseif ($this->doctype == self::DOCTYPE_XHTML1_0_FRAMESET ||
                $this->doctype == self::DOCTYPE_XHTML1_0_STRICT ||
                $this->doctype == self::DOCTYPE_XHTML1_0_TRANSITIONAL) {
            $html = '<meta %s="%s" content="%s"%s />';
        } else {
            $html = '<meta %s="%s" content="%s"%s>';
        }

        $meta = sprintf($html, $type, $typeValue, $content, $modifiersString);

        $this->headmeta[] = $meta;
    }
1025534
public function deserializeDateTimeFromJson(JsonDeserializationVisitor $visitor, $data, array $type)
    {
        if (null === $data) {
            return null;
        }

        return parent::deserializeDateTimeFromJson(
            $visitor,
            $this->dateConverter->getDateTimeStringInFormat($data),
            $type
        );
    }