Parse xCalendar and xCard properties.

@param Component $parentComponent
@param string    $propertyNamePrefix
498167
protected function parseProperties(Component $parentComponent, $propertyNamePrefix = '')
    {
        foreach ($this->pointer ?: [] as $xmlProperty) {
            list($namespace, $tagName) = SabreXml\Service::parseClarkNotation($xmlProperty['name']);

            $propertyName = $tagName;
            $propertyValue = [];
            $propertyParameters = [];
            $propertyType = 'text';

            // A property which is not part of the standard.
            if (self::XCAL_NAMESPACE !== $namespace
                && self::XCARD_NAMESPACE !== $namespace) {
                $propertyName = 'xml';
                $value = '<'.$tagName.' xmlns="'.$namespace.'"';

                foreach ($xmlProperty['attributes'] as $attributeName => $attributeValue) {
                    $value .= ' '.$attributeName.'="'.str_replace('"', '\"', $attributeValue).'"';
                }

                $value .= '>'.$xmlProperty['value'].'</'.$tagName.'>';

                $propertyValue = [$value];

                $this->createProperty(
                    $parentComponent,
                    $propertyName,
                    $propertyParameters,
                    $propertyType,
                    $propertyValue
                );

                continue;
            }

            // xCard group.
            if ('group' === $propertyName) {
                if (!isset($xmlProperty['attributes']['name'])) {
                    continue;
                }

                $this->pointer = &$xmlProperty['value'];
                $this->parseProperties(
                    $parentComponent,
                    strtoupper($xmlProperty['attributes']['name']).'.'
                );

                continue;
            }

            // Collect parameters.
            foreach ($xmlProperty['value'] as $i => $xmlPropertyChild) {
                if (!is_array($xmlPropertyChild)
                    || 'parameters' !== static::getTagName($xmlPropertyChild['name'])) {
                    continue;
                }

                $xmlParameters = $xmlPropertyChild['value'];

                foreach ($xmlParameters as $xmlParameter) {
                    $propertyParameterValues = [];

                    foreach ($xmlParameter['value'] as $xmlParameterValues) {
                        $propertyParameterValues[] = $xmlParameterValues['value'];
                    }

                    $propertyParameters[static::getTagName($xmlParameter['name'])]
                        = implode(',', $propertyParameterValues);
                }

                array_splice($xmlProperty['value'], $i, 1);
            }

            $propertyNameExtended = ($this->root instanceof VCalendar
                                      ? 'xcal'
                                      : 'xcard').':'.$propertyName;

            switch ($propertyNameExtended) {
                case 'xcal:geo':
                    $propertyType = 'float';
                    $propertyValue['latitude'] = 0;
                    $propertyValue['longitude'] = 0;

                    foreach ($xmlProperty['value'] as $xmlRequestChild) {
                        $propertyValue[static::getTagName($xmlRequestChild['name'])]
                            = $xmlRequestChild['value'];
                    }
                    break;

                case 'xcal:request-status':
                    $propertyType = 'text';

                    foreach ($xmlProperty['value'] as $xmlRequestChild) {
                        $propertyValue[static::getTagName($xmlRequestChild['name'])]
                            = $xmlRequestChild['value'];
                    }
                    break;

                case 'xcal:freebusy':
                    $propertyType = 'freebusy';
                    // We don't break because we only want to set
                    // another property type.

                    // no break
                case 'xcal:categories':
                case 'xcal:resources':
                case 'xcal:exdate':
                    foreach ($xmlProperty['value'] as $specialChild) {
                        $propertyValue[static::getTagName($specialChild['name'])]
                            = $specialChild['value'];
                    }
                    break;

                case 'xcal:rdate':
                    $propertyType = 'date-time';

                    foreach ($xmlProperty['value'] as $specialChild) {
                        $tagName = static::getTagName($specialChild['name']);

                        if ('period' === $tagName) {
                            $propertyParameters['value'] = 'PERIOD';
                            $propertyValue[] = implode('/', $specialChild['value']);
                        } else {
                            $propertyValue[] = $specialChild['value'];
                        }
                    }
                    break;

                default:
                    $propertyType = static::getTagName($xmlProperty['value'][0]['name']);

                    foreach ($xmlProperty['value'] as $value) {
                        $propertyValue[] = $value['value'];
                    }

                    if ('date' === $propertyType) {
                        $propertyParameters['value'] = 'DATE';
                    }
                    break;
            }

            $this->createProperty(
                $parentComponent,
                $propertyNamePrefix.$propertyName,
                $propertyParameters,
                $propertyType,
                $propertyValue
            );
        }
    }
1019383
public function setFieldPrefix($fieldPrefix)
    {
        if (empty($this->mappingOptions)) $this->resetMappingOptions();

        $this->mappingOptions->fieldPrefix = $fieldPrefix;

        return $this;
    }
864553
public function convert(\DOMElement $parent, PropertyDescriptor $property)
    {
        $fullyQualifiedNamespaceName = $property->getNamespace() instanceof NamespaceDescriptor
            ? $property->getNamespace()->getFullyQualifiedStructuralElementName()
            : $parent->getAttribute('namespace');

        $child = new \DOMElement('property');
        $parent->appendChild($child);

        $child->setAttribute('static', var_export($property->isStatic(), true));
        $child->setAttribute('visibility', $property->getVisibility());
        $child->setAttribute('namespace', $fullyQualifiedNamespaceName);
        $child->setAttribute('line', (string) $property->getLine());

        $child->appendChild(new \DOMElement('name', '$' . $property->getName()));
        $child->appendChild(new \DOMElement('full_name', (string) $property->getFullyQualifiedStructuralElementName()));
        $child->appendChild(new \DOMElement('default'))->appendChild(new \DOMText((string) $property->getDefault()));

        $this->docBlockConverter->convert($child, $property);

        return $child;
    }
1055039
private function handleNotFound(?PropertyMetadata $parentPropertyMetadata, string $resourceClass, string $property): PropertyMetadata
    {
        if ($parentPropertyMetadata) {
            return $parentPropertyMetadata;
        }

        throw new PropertyNotFoundException(sprintf('Property "%s" of the resource class "%s" not found.', $property, $resourceClass));
    }
546635
protected function parseVCalendarComponents(Component $parentComponent)
    {
        foreach ($this->pointer['value'] ?: [] as $children) {
            switch (static::getTagName($children['name'])) {
                case 'properties':
                    $this->pointer = &$children['value'];
                    $this->parseProperties($parentComponent);
                    break;

                case 'components':
                    $this->pointer = &$children;
                    $this->parseComponent($parentComponent);
                    break;
            }
        }
    }
914167
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $scope    = Scope::PROTOTYPE;
        $name     = $objectAnnotation->getName();
        $beanName = empty($name) ? $className : $name;

        ProcessCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);

        return [$beanName, $scope, ""];
    }
136215
private function condition(ParentNode $node, $property_name) {
    $this->mustMatch('(', $node, 'openParen');
    if ($this->currentType === T_YIELD) {
      $node->addChild($this->_yield(), $property_name);
    }
    else {
      $node->addChild($this->expr(), $property_name);
    }
    $this->mustMatch(')', $node, 'closeParen');
  }
44195
private function isRestoreProperty($propertyName, $contentPrefix, $systemPrefix)
    {
        // return all localized and non-translatable properties
        // non-translatable properties can be recognized by their missing namespace, therfore the check for the colon
        if (0 === strpos($propertyName, $contentPrefix)
            || 0 === strpos($propertyName, $systemPrefix)
            || false === strpos($propertyName, ':')
        ) {
            return true;
        }

        return false;
    }
858089
function createComponent( &$xcaldecl ) {
    $objectname    = $this->_createFormat();
    $component     = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
    $component    .= $this->createUid();
    $component    .= $this->createDtstamp();
    $component    .= $this->createAttach();
    $component    .= $this->createAttendee();
    $component    .= $this->createCategories();
    $component    .= $this->createClass();
    $component    .= $this->createComment();
    $component    .= $this->createCompleted();
    $component    .= $this->createContact();
    $component    .= $this->createCreated();
    $component    .= $this->createDescription();
    $component    .= $this->createDtstart();
    $component    .= $this->createDue();
    $component    .= $this->createDuration();
    $component    .= $this->createExdate();
    $component    .= $this->createExrule();
    $component    .= $this->createGeo();
    $component    .= $this->createLastModified();
    $component    .= $this->createLocation();
    $component    .= $this->createOrganizer();
    $component    .= $this->createPercentComplete();
    $component    .= $this->createPriority();
    $component    .= $this->createRdate();
    $component    .= $this->createRelatedTo();
    $component    .= $this->createRequestStatus();
    $component    .= $this->createRecurrenceid();
    $component    .= $this->createResources();
    $component    .= $this->createRrule();
    $component    .= $this->createSequence();
    $component    .= $this->createStatus();
    $component    .= $this->createSummary();
    $component    .= $this->createUrl();
    $component    .= $this->createXprop();
    if( $this->nl != substr( $component, ( 0 - strlen( $this->nl ))))
      $component  .= $this->nl;
    $component    .= $this->createSubComponent();
    $component    .= $this->componentEnd1.$objectname.$this->componentEnd2;
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
      foreach( $this->xcaldecl as $localxcaldecl )
        $xcaldecl[] = $localxcaldecl;
    }
    return $component;
  }
658560
private function resolveExpectedSuffix(string $parentType): string
    {
        if (Strings::endsWith($parentType, 'Interface')) {
            $parentType = Strings::substring($parentType, 0, -strlen('Interface'));
        }

        if (Strings::endsWith($parentType, 'Abstract')) {
            $parentType = Strings::substring($parentType, 0, -strlen('Abstract'));
        }

        if (Strings::startsWith($parentType, 'Abstract')) {
            $parentType = Strings::substring($parentType, strlen('Abstract'));
        }

        return $parentType;
    }
490670
private function doCallBackMultiProp(array $propertyList, callable $callback)
    {
        $argument = [];
        foreach ($propertyList as $propertyName) {
            $argument[$propertyName] = $this->mutations[$propertyName];
        }

        $result = $callback($argument);

        if (is_array($result)) {
            foreach ($propertyList as $propertyName) {
                if (!isset($result[$propertyName])) {
                    $resultCode = 500;
                } else {
                    $resultCode = $result[$propertyName];
                }
                if ($resultCode >= 400) {
                    $this->failed = true;
                }
                $this->result[$propertyName] = $resultCode;
            }
        } elseif (true === $result) {
            // Success
            foreach ($argument as $propertyName => $propertyValue) {
                $this->result[$propertyName] = is_null($propertyValue) ? 204 : 200;
            }
        } elseif (false === $result) {
            // Fail :(
            $this->failed = true;
            foreach ($propertyList as $propertyName) {
                $this->result[$propertyName] = 403;
            }
        } else {
            throw new UnexpectedValueException('A callback sent to handle() did not return an array or a bool');
        }
    }
442735
private function parseRelationshipLinks(
        SchemaInterface $parentSchema,
        $parentData,
        string $name,
        array $description
    ): array {
        $addSelfLink    = $description[SchemaInterface::RELATIONSHIP_LINKS_SELF] ??
            $parentSchema->isAddSelfLinkInRelationshipByDefault($name);
        $addRelatedLink = $description[SchemaInterface::RELATIONSHIP_LINKS_RELATED] ??
            $parentSchema->isAddRelatedLinkInRelationshipByDefault($name);
        \assert(\is_bool($addSelfLink) === true || $addSelfLink instanceof LinkInterface);
        \assert(\is_bool($addRelatedLink) === true || $addRelatedLink instanceof LinkInterface);

        $schemaLinks = $description[SchemaInterface::RELATIONSHIP_LINKS] ?? [];
        \assert(\is_array($schemaLinks));

        // if `self` or `related` link was given as LinkInterface merge it with the other links
        $extraSchemaLinks = null;
        if (\is_bool($addSelfLink) === false) {
            $extraSchemaLinks[LinkInterface::SELF] = $addSelfLink;
            $addSelfLink                           = false;
        }
        if (\is_bool($addRelatedLink) === false) {
            $extraSchemaLinks[LinkInterface::RELATED] = $addRelatedLink;
            $addRelatedLink                           = false;
        }
        if (empty($extraSchemaLinks) === false) {
            // IDE do not understand it's defined without he line below
            \assert(isset($extraSchemaLinks));
            $schemaLinks = \array_merge($extraSchemaLinks, $schemaLinks);
            unset($extraSchemaLinks);
        }
        \assert(\is_bool($addSelfLink) === true && \is_bool($addRelatedLink) === true);

        $hasLinks = $addSelfLink === true || $addRelatedLink === true || empty($schemaLinks) === false;
        $links    = $hasLinks === true ?
            $this->parseLinks($parentSchema, $parentData, $name, $schemaLinks, $addSelfLink, $addRelatedLink) : null;

        return [$hasLinks, $links];
    }
406655
public function setProperty($propertyName, $propertyValue)
    {
        Validate::isString($propertyName, 'propertyName');
        Validate::notNull($propertyValue, 'propertyValue');

        $this->_customProperties[strtolower($propertyName)] = $propertyValue;
    }
1311392
protected function parsePropertyCallbacks(ContainerInterface $container, EventDispatcherInterface $dispatcher)
    {
        foreach ((array) $this->getFromDca('fields') as $propName => $propInfo) {
            $args = [$container->getName(), $propName];
            foreach ([
                    'load_callback'        => [
                        'event' => DecodePropertyValueForWidgetEvent::NAME,
                        'class' => PropertyOnLoadCallbackListener::class
                    ],
                    'save_callback'        => [
                        'event' => EncodePropertyValueFromWidgetEvent::NAME,
                        'class' => PropertyOnSaveCallbackListener::class
                    ],
                    'options_callback'     => [
                        'event' => GetPropertyOptionsEvent::NAME,
                        'class' => ModelOptionsCallbackListener::class
                    ],
                    'input_field_callback' => [
                        'event' => BuildWidgetEvent::NAME,
                        'class' => PropertyInputFieldCallbackListener::class
                    ],
                    'wizard'               => [
                        'event' => ManipulateWidgetEvent::NAME,
                        'class' => PropertyInputFieldGetWizardCallbackListener::class
                    ],
                    'xlabel'               => [
                        'event' => ManipulateWidgetEvent::NAME,
                        'class' => PropertyInputFieldGetXLabelCallbackListener::class
                    ]
                ] as $name => $callback) {
                if (isset($propInfo[$name])) {
                    $this->parseCallback($dispatcher, $propInfo[$name], $callback['event'], $args, $callback['class']);
                }
            }
        }
    }
1215202
private function parentIsFromProvider($conjunction, $parentProviderName)
    {
        if (!empty($this->expression)) {
            $this->expression[] = $conjunction;
        }

        $index              = \count($this->variables);
        $this->expression[] = \sprintf(self::PARENT_IS_FROM_PROVIDER_EXPRESSION, $index);
        $this->variables[]  = $parentProviderName;
        $this->compiled     = null;

        return $this;
    }
50723
@Override
    public final void processComponent(String propertyName, final JComponent component) {

        final AbstractOverlayHandler overlayHandler = this.createOverlayHandler(propertyName, component);

        // Wait until has parent and overlay is correctly installed
        final PropertyChangeListener wait4ParentListener = new PropertyChangeListener() {

            public void propertyChange(PropertyChangeEvent e) {

                final JComponent targetComponent = overlayHandler.getTargetComponent();
                final JComponent overlay = overlayHandler.getOverlay();

                // Install overlay
                final int position = AbstractOverlayFormComponentInterceptor.this.getPosition();
                final Boolean success = AbstractOverlayFormComponentInterceptor.this.//
                        getOverlayService().installOverlay(targetComponent, overlay, position, null);

                if (success) {
                    targetComponent.removePropertyChangeListener(//
                            AbstractOverlayFormComponentInterceptor.ANCESTOR_PROPERTY, this);
                }
            }
        };

        component.addPropertyChangeListener(//
                AbstractOverlayFormComponentInterceptor.ANCESTOR_PROPERTY, wait4ParentListener);
    }
869353
function (transaction, hostParent, hostContainerInfo, context) {
	    if (false) {
	      var parentInfo;
	      if (hostParent != null) {
	        parentInfo = hostParent._ancestorInfo;
	      } else if (hostContainerInfo != null) {
	        parentInfo = hostContainerInfo._ancestorInfo;
	      }
	      if (parentInfo) {
	        // parentInfo should always be present except for the top-level
	        // component when server rendering
	        validateDOMNesting(null, this._stringText, this, parentInfo);
	      }
	    }
	
	    var domID = hostContainerInfo._idCounter++;
	    var openingValue = ' react-text: ' + domID + ' ';
	    var closingValue = ' /react-text ';
	    this._domID = domID;
	    this._hostParent = hostParent;
	    if (transaction.useCreateElement) {
	      var ownerDocument = hostContainerInfo._ownerDocument;
	      var openingComment = ownerDocument.createComment(openingValue);
	      var closingComment = ownerDocument.createComment(closingValue);
	      var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
	      DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
	      if (this._stringText) {
	        DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
	      }
	      DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
	      ReactDOMComponentTree.precacheNode(this, openingComment);
	      this._closingComment = closingComment;
	      return lazyTree;
	    } else {
	      var escapedText = escapeTextContentForBrowser(this._stringText);
	
	      if (transaction.renderToStaticMarkup) {
	        // Normally we'd wrap this between comment nodes for the reasons stated
	        // above, but since this is a situation where React won't take over
	        // (static pages), we can simply return the text as it is.
	        return escapedText;
	      }
	
	      return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
	    }
	  }