Mapping/Driver/AnnotationDriver.php
private function getAnnotation(Reflector $element, $annotation)
    {
        if ($element instanceof ReflectionClass) {
            return $this->reader->getClassAnnotation($element, $annotation);
        } elseif ($element instanceof ReflectionMethod) {
            return $this->reader->getMethodAnnotation($element, $annotation);
        } elseif ($element instanceof ReflectionProperty) {
            return $this->reader->getPropertyAnnotation($element, $annotation);
        }

        return null;
    }
private function getAnnotation(Reflector $element, $annotation)
    {
        if ($element instanceof ReflectionClass) {
            return $this->reader->getClassAnnotation($element, $annotation);
        } elseif ($element instanceof ReflectionMethod) {
            return $this->reader->getMethodAnnotation($element, $annotation);
        } elseif ($element instanceof ReflectionProperty) {
            return $this->reader->getPropertyAnnotation($element, $annotation);
        }

        return null;
    }
Get the specified annotation of an element

@param  Reflector $element    The element whose annotation should be
retrieved
@param  string    $annotation The class of the annotation to retrieve

@return object|null The annotation or null if the element doesn't
have the specified annotation