public function addFromAnnotations($classname, $filter = "") {
        $loops = $this->getLoops();

        //init elements from annotations
        $properties = $loops->getService("annotations")->get(is_object($classname) ? get_class($classname) : $classname)->properties;

        $result = [];

        foreach($properties->find("Form\Element") as $key => $annotations) {
            foreach($annotations as $annotation) {
                if(!array_intersect((array)$annotation->filter, (array)$filter)) {
                    continue;
                }

                $element = $annotation->factory($this, $loops);
                $this->$key = $element;

                foreach($properties->$key->find("Form\Validator") as $annotation) {
                    if(!array_intersect((array)$annotation->filter, (array)$filter)) {
                        continue;
                    }

                    $element->addValidator($annotation->factory($element, $loops));
                }

                foreach($properties->$key->find("Form\Filter") as $annotation) {
                    if(!array_intersect((array)$annotation->filter, (array)$filter)) {
                        continue;
                    }

                    $element->addFilter($annotation->factory($element, $loops));
                }

                $result[$key] = $element;
                break;
            }
        }

        if(is_object($classname) && $classname !== $this) {
            $this->bindEventObject($classname, [ "Form\onValidate", "Form\onConfirm", "Form\onSubmit", "Form\onCleanup" ]);
        }

        foreach($this->getFormElements() as $name => $child) {
            if($this->value->offsetExists($name)) {
                $child->setValue($this->value->offsetGet($name));
            }
            else {
                $this->value->offsetSet($name, $child->getDefault());
            }
        }

        return $result;
    }