public function annotations()
    {
        static $annotations;
        if (!isset($annotations)) {
            $annotator = get_class($this);
            if (strpos($annotator, '@anonymous')) {
                $annotator = (new ReflectionClass($this))
                    ->getParentClass()->name;
            }
            $reflector = new ReflectionClass($annotator);
            $annotations['class'] = new Annotations($reflector);
            $annotations['methods'] = [];
            foreach ($reflector->getMethods() as $method) {
                $annotations['methods'][$method->getName()]
                    = new Annotations($method);
            }
            foreach ($reflector->getProperties() as $property) {
                $annotations['properties'][$property->getName()]
                    = new Annotations($property);
            }
        }
        return $annotations;
    }