protected function hydrateStruct(array $struct, StructNode $structNode)
 {
     $className = $structNode->getClassName();
     if ($className !== NULL) {
         $structObject = new $className();
         $hydrator = $this->hydratorFactory->getHydrator($className);
         $defaultData = $hydrator->extract($structObject);
         $struct = array_merge($defaultData, $struct);
         $hydrator->hydrate($struct, $structObject);
         return $structObject;
     }
     return $struct;
 }
 public function parseStruct(StructNode $structNode)
 {
     $struct = array();
     foreach ($structNode->getFields() as $key => $index) {
         $struct[$key] = $this->parse($index);
     }
     return $struct;
 }