|
Java源碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的Java詞法解析引擎全面地分析您的源碼並根據用戶自定義的Java語言源碼風格重構和美化Java源碼檔案,因此它能精細地根據不同的源碼風格美化多種源碼,甚至是下面這些極度混亂的源碼:
|
Java源碼美化範例:
範例1
|
範例2
|
範例3
|
範例4
這是一個非常極端的 Java 源碼美化的範例,其目的是為了展示 SourceFormatX Java 源碼美化工具詞法解析引擎的威力。
import ninja2.core.io_core.nbio.*;import java.io.*;import java.net.*;public
class NBIOServer{public static void main(String args[]){try{System.err.println(
"NBIO server starting...");NonblockingServerSocket s=new
NonblockingServerSocket(4046);NonblockingSocket clisock=s.accept();
System.err.println("Got connection from "+clisock.getInetAddress().getHostName(
));InputStream is=clisock.getInputStream();byte barr[]=new byte[1024];while(
true){int c=is.read(barr,0,1024);if(c==-1){System.err.println("READ ERROR");}
else if(c==0){System.err.println("READ NOTHING");}else{String str=new String(
barr,0,c);System.err.println("READ: "+str);}}}catch(Exception e){
System.err.println("NBIOServer: Caught exception: "+e);e.printStackTrace();
System.exit(-1);}}}
import ninja2.core.io_core.nbio.*;
import java.io.*;
import java.net.*;
public class NBIOServer
{
public static void main(String args[])
{
try
{
System.err.println("NBIO server starting...");
NonblockingServerSocket s = new NonblockingServerSocket(4046);
NonblockingSocket clisock = s.accept();
System.err.println("Got connection from " + clisock.getInetAddress()
.getHostName());
InputStream is = clisock.getInputStream();
byte barr[] = new byte[1024];
while (true)
{
int c = is.read(barr, 0, 1024);
if (c == -1)
{
System.err.println("READ ERROR");
}
else if (c == 0)
{
System.err.println("READ NOTHING");
}
else
{
String str = new String(barr, 0, c);
System.err.println("READ: " + str);
}
}
}
catch (Exception e)
{
System.err.println("NBIOServer: Caught exception: " + e);
e.printStackTrace();
System.exit(-1);
}
}
}
範例1
|
範例2
|
範例3
|
範例4
|