public function setRef(ItemReferenceInterface $item) 
    {
        $className = ClassUtils::getRealClass(get_class($item));
        
        $classMap = $this->getClassMap();
        if(!isset($classMap[$className])){
            throw new LogicException(sprintf("No ha definido la configuracion de '%s' para generar su referencia",$className));
        }
        $resolver = new \Symfony\Component\OptionsResolver\OptionsResolver();
        $resolver->setDefined([
            "method","field","options","mask"
        ]);
        $resolver->setDefaults([
            'method' => 'buildRef',
            'field' => 'ref',
            'use_cache' => false,
//            'options' => array()
        ]);
        
        $config = $resolver->resolve($classMap[$className]);
        $config['className'] = $className;
        $method = $config['method'];
        $ref = $this->$method($item,$config);
        $item->setRef($ref);
        return $ref;
    }