SourceFormatX

製品概要

機能一覧

なぜ使用

使用例

IDE への統合

スクリーンショット

よくあるご質問

機能履歴

受賞賞一覧

ユーザーコメント

ライセンス

CodeToHtml

Java言語のソースコード整形例



SourceFormatXソースコード整形ツールの重要な特徴

SourceFormatX は優れた構文解析エンジンを元に作られています。ですのであらゆるスタイルで書かれたソースコードを美しく整形することができます。以下の例のようなめちゃくちゃなコードでさえも、整形することが可能です。

C/C++ Java C# Delphi (Pascal)
PHP JSP ASP HTML Components
Visual Basic VB.NET VBScript JavaScript
80x86 ASM 8051 ASM CORBA IDL

これは極端な例ですが。SourceFormatXに搭載されている強力な Java言語 のパーサーエンジンの実力を感じて頂けるかと思います。

  /* Java言語のソースコード整形 */

  package cryptix.examples;import java.io.FileInputStream;import
  java.io.IOException;import cryptix.security.MD5;
  /** This is a demo of how to use the MD5 or SHA1 classes for hashing data **/
  public final class MD5AFile{private static final int BUF_LENGTH=1024;public
  static void main(String argv[]){if(argv.length!=1)System.err.println(
  "usage java MD5Afile filename");else try{printHash(doHash(argv[0]));}catch(
  IOException ioe){System.err.println(
  "There has been an IO exception to the file was not hashed.");
  ioe.printStackTrace();}}private static void printHash(byte buf[]){
  System.out.println("hash of file is;");System.out.print("MD5 : ");for(int i=0,j
  =buf.length;j>0;i++,j--){int val=(int)buf[i];System.out.print(Integer.toString(
  (val>>4)&0xF,16));System.out.print(Integer.toString(val&0xF,16));}
  System.out.println();}}

  /* Java言語のソースコード整形 */

  package cryptix.examples;
  import java.io.FileInputStream;
  import java.io.IOException;
  import cryptix.security.MD5;
  
  /** This is a demo of how to use the MD5 or SHA1 classes for hashing data **/
  
  public final class MD5AFile
  {
    private static final int BUF_LENGTH = 1024;
    public static void main(String argv[])
    {
      if (argv.length != 1)
        System.err.println("usage java MD5Afile filename");
      else
      try
      {
        printHash(doHash(argv[0]));
      }
      catch (IOException ioe)
      {
        System.err.println(
          "There has been an IO exception to the file was not hashed.");
        ioe.printStackTrace();
      }
    }
    private static void printHash(byte buf[])
    {
      System.out.println("hash of file is;");
      System.out.print("MD5 : ");
      for (int i = 0, j = buf.length; j > 0; i++, j--)
      {
        int val = (int)buf[i];
        System.out.print(Integer.toString((val >> 4) & 0xF, 16));
        System.out.print(Integer.toString(val & 0xF, 16));
      }
      System.out.println();
    }
  }
  

  再び手動でJava言語のソースコードを整形するために時を浪費しないで下さい! SourceFormatX体験版の無料ダウンロード!