public function getProperty(NodeInterface $node, $propertyName)
{
if ($propertyName[0] === '_') {
$propertyValue = ObjectAccess::getProperty($node, ltrim($propertyName, '_'));
} else {
$propertyValue = $node->getProperty($propertyName);
}
$dataType = $node->getNodeType()->getPropertyType($propertyName);
try {
$convertedValue = $this->convertValue($propertyValue, $dataType);
} catch (PropertyException $exception) {
$this->systemLogger->logException($exception);
$convertedValue = null;
}
if ($convertedValue === null) {
$convertedValue = $this->getDefaultValueForProperty($node->getNodeType(), $propertyName);
}
return $convertedValue;
}