public static function serializeAnnotations($annotations, $glue = '')
    {
        $returnValue = (string) '';

        // Set default glue.
        if ($glue == ''){
            $glue = "\n    ";
        }
        
        $a = array();
        foreach ($annotations as $n => $v){
            $v = str_replace("\\", "\\\\", $v);
            $v = str_replace('--', "\\-\\-", $v);
            $a[] = '@' . trim($n) . " ${v}";
        }
        $returnValue = implode($glue, $a);

        return (string) $returnValue;
    }