protected function parseClassSpecifications(ClassReflection $class, ArrayObject $serviceSpec)
    {
        if ($class->getParentClass()) {
            $this->parseClassSpecifications($class->getParentClass(), $serviceSpec);
        }
        
        $annotationManager = $this->getAnnotationManager();
        $annotations = $class->getAnnotations($annotationManager);
        
        if (!array_key_exists('version', $serviceSpec)) {
            $serviceSpec['version'] = null;
        }
        
        // Each class must define its own exclusion pattern
        $serviceSpec['exclude_patterns'] = array();
        $serviceSpec['exclude'] = false;
        $serviceSpec['contexts'] = array('native');
        
        if ($annotations instanceof AnnotationCollection) {
            $this->configureService($annotations, $class, $serviceSpec);
        }
        
        // Exit here if service is excluded
        if ($serviceSpec['exclude']) {
            return;
        }
        
        foreach ($class->getMethods() as $method) {
            
            // Skip method if it is not owned by this class
            if ($method->getDeclaringClass()->getName() !== $class->getName()) {
                continue;
            }
            
            // Skip method declared in Trait due to ZF2 bug
            if ($this->isDeclaredInTrait($method)) {
                continue;
            }
            
            try{
                $annotations = $method->getAnnotations($annotationManager);
            } catch(\Doctrine\Common\Annotations\AnnotationException $e) {
                throw new AnnotationException(
                    'Error parsing annotation for class "'.$class->getName().'::'.$method->getName().'"', 0, $e);
            } catch(\Exception $e) {
                // Due to ZF2 bug with parsing annotations for traits, skip related error
                if (strpos($e->getMessage(), 'Argument 3 passed to Zend\Code\Scanner\AnnotationScanner') === 0) {
                    continue;
                }
                
                throw $e;
            }
            
            if (!$annotations instanceof AnnotationCollection) {
                $annotations = new AnnotationCollection();
            }
        
            $this->configureOperation($annotations, $method, $serviceSpec);
        }
    }