protected function isReference($data)
    {
        // is a reference object
        if (is_object($data) && $data instanceof ReferenceAbstract) {
            return $data;

        // is string and matches reference pattern
        } elseif (is_string($data)) {
            $pat = '/^(@|%)([^\s]+)\1$/';
            $mat = []; // placeholders

            if (preg_match($pat, $data, $mat)) {
                return $mat[1] === '@' ?
                    new ServiceReference($mat[2]) :
                    new ParameterReference($mat[2]);
            }

            // parameter resolver support
            if ($this->hasResolver() &&
                $this->getResolver()->hasReference($data)) {

                list($s, $e) = $this->paramter_pattern;
                $pat = '/^' . preg_quote($s) . '([^\s]+)' . preg_quote($e). '$/';
                if (preg_match($pat, $data, $mat)) {
                    return new ParameterReference($mat[1]);
                }
            }

            return false;

        // not a match
        } else {
            return false;
        }
    }