Logo Search packages:      
Sourcecode: jardiff version File versions  Download package

final String org::osjava::jardiff::StreamDiffHandler::xmlEscape ( final String  str  )  [inline, private]

Escape some text into a format suitable for output as xml.

Parameters:
str the text to format
Returns:
the formatted text

Definition at line 764 of file StreamDiffHandler.java.

Referenced by addTypeNode(), contains(), startClassChanged(), startDiff(), writeClassInfo(), writeFieldInfo(), and writeMethodInfo().

                                                     {
        StringBuffer ret = new StringBuffer(str.length());
        for(int i=0;i<str.length();i++) {
            char ch = str.charAt(i);
            switch(ch) {
                case '<':
                    ret.append("&lt;");
                    break;
                case '&':
                    ret.append("&amp;");
                    break;
                case '>':
                    ret.append("&gt;");
                    break;
                default:
                    ret.append(ch);
            }
        }
        return ret.toString();
    }


Generated by  Doxygen 1.6.0   Back to index