Lines Matching refs:metadata

105 …public function createRoot(?ClassMetadata $metadata = null, ?string $rootName = null, ?string $roo…  argument
107 if (null !== $metadata && !empty($metadata->xmlRootName)) {
108 $rootPrefix = $metadata->xmlRootPrefix;
109 $rootName = $metadata->xmlRootName;
110 … $rootNamespace = $metadata->xmlRootNamespace ?: $this->getClassDefaultNamespace($metadata);
222 public function startVisitingObject(ClassMetadata $metadata, object $data, array $type): void argument
224 $this->objectMetadataStack->push($metadata);
227 $this->createRoot($metadata);
230 $this->addNamespaceAttributes($metadata, $this->currentNode);
238 public function visitProperty(PropertyMetadata $metadata, $v): void argument
240 if ($metadata->xmlAttribute) {
241 $this->setCurrentMetadata($metadata);
242 $node = $this->navigator->accept($v, $metadata->type);
246 …value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encod…
249 …$this->setAttributeOnNode($this->currentNode, $metadata->serializedName, $node->nodeValue, $metada…
254 if (($metadata->xmlValue && $this->currentNode->childNodes->length > 0)
255 || (!$metadata->xmlValue && $this->hasValue)
257 …s must have the @XmlAttribute annotation. Invalid usage detected in class %s.', $metadata->class));
260 if ($metadata->xmlValue) {
263 $this->setCurrentMetadata($metadata);
264 $node = $this->navigator->accept($v, $metadata->type);
268 …roperty %s::$%s. Expected character data, but got %s.', $metadata->reflection->class, $metadata->r…
276 if ($metadata->xmlAttributeMap) {
282 $this->setCurrentMetadata($metadata);
290 … $this->setAttributeOnNode($this->currentNode, $key, $node->nodeValue, $metadata->xmlNamespace);
296 if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) {
297 $namespace = null !== $metadata->xmlNamespace
298 ? $metadata->xmlNamespace
301 $element = $this->createElement($metadata->serializedName, $namespace);
306 $this->setCurrentMetadata($metadata);
309 if (null !== $node = $this->navigator->accept($v, $metadata->type)) {
325 … (null === $v || $this->isSkippableCollection($metadata) || $this->isSkippableEmptyObject($node, $
333 private function isInLineCollection(PropertyMetadata $metadata): bool argument
335 return $metadata->xmlCollection && $metadata->xmlCollectionInline;
338 private function isSkippableEmptyObject(?\DOMElement $node, PropertyMetadata $metadata): bool argument
340 return null === $node && !$metadata->xmlCollection && $metadata->skipWhenEmpty;
343 private function isSkippableCollection(PropertyMetadata $metadata): bool argument
345 return $metadata->xmlCollection && $metadata->xmlCollectionSkipWhenEmpty;
353 public function endVisitingObject(ClassMetadata $metadata, object $data, array $type): void argument
402 public function setCurrentMetadata(PropertyMetadata $metadata): void argument
405 $this->currentMetadata = $metadata;
451 private function addNamespaceAttributes(ClassMetadata $metadata, \DOMElement $element): void argument
453 foreach ($metadata->xmlNamespaces as $prefix => $uri) {