com.yworks.yshrink.util.XmlLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yguard Show documentation
Show all versions of yguard Show documentation
The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts
package com.yworks.yshrink.util;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
/**
* @author Michael Schroeder, yWorks GmbH http://www.yworks.com
*/
public class XmlLogger extends Logger {
private PrintWriter pw;
public XmlLogger( PrintWriter pw ) {
this.pw = pw;
pw.println("");
pw.println("");
register();
}
public void doLog( String s ) {
pw.println( "" );
}
public void doErr( String s ) {
pw.println( "" );
}
public void doErr( String s, Throwable ex ) {
pw.println( "" );
}
public void doWarn( String s ) {
pw.println( "" );
}
public void doWarnToLog( String s ) {
pw.println( "" );
}
public void doShrinkLog( String s ) {
pw.println( s );
}
public void close() {
pw.println(" ");
pw.println();
pw.close();
unregister();
}
public static String replaceSpecialChars( String s ) {
StringReader reader = new StringReader( s );
StringBuilder r = new StringBuilder();
int i;
try {
while( (i = reader.read()) != -1 ) {
char c = (char) i;
switch( c ) {
case '>' :
r.append( ">" );
break;
case '<':
r.append( "<" );
break;
default:
r.append( c );
}
}
} catch ( IOException e ) {
Logger.err( e.getMessage() );
}
return r.toString();
}
}