Changeset 7733

Show
Ignore:
Timestamp:
03/10/08 02:17:07 (5 years ago)
Author:
shogo4405
Message:

lang/java/utiljs: リファクタリングとコメントの追加

Location:
lang/java/utiljs/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • lang/java/utiljs/trunk/src/org/coderepos/utiljs/Arguments.java

    r6802 r7733  
    55import java.util.*; 
    66 
     7/** 
     8 * 可変長引数を作成するためのクラス 
     9 * @author shogo4405 
     10 * @since 0.0.2 
     11 */ 
    712public class Arguments extends ArrayList<String> 
    813{ 
    914        private static final long serialVersionUID = -8908989881175550220L; 
    1015 
     16        /** 
     17         * 第一引数がtrueのときに、第二引数以降の文字列を追加します。 
     18         * @param b 文字列の追加を許可するか否かのフラグ  
     19         * @param strs 可変長文字列 
     20         */ 
    1121        public void addIf(boolean b, String... strs) 
    1222        { 
     
    1727        }; 
    1828 
     29        /** 
     30         * 引数リストを文字列型の配列に変換します。 
     31         * @return 引数リスト 
     32         */ 
    1933        public String[] toArray() 
    2034        { 
  • lang/java/utiljs/trunk/src/org/coderepos/utiljs/shell/Main.java

    r6802 r7733  
    66public class Main 
    77{ 
    8          
     8        public static void main(String[] args) 
     9        { 
     10                 
     11        }; 
    912}; 
  • lang/java/utiljs/trunk/src/org/coderepos/utiljs/taskdefs/JSCompress.java

    r6802 r7733  
    1515         */ 
    1616        protected Pattern defaultType = Pattern.compile(".*\\.js$"); 
    17  
    18         /** 
    19          * 圧縮対象外のファイルもコピーするかのフラグ 
    20          */ 
    21         private boolean copy = false; 
    2217 
    2318        /** 
     
    6358         * 単一ファイルの操作 
    6459         */ 
     60 
    6561        protected abstract void doFileOperation(File srcFile, File destFile); 
    6662 
     
    8884        protected void doFileOperations(String srcDir, String destDir){ 
    8985                doFileOperations(new File(srcDir), new File(destDir)); 
    90         }; 
    91  
    92         /** 
    93          * ファイルコピー操作 
    94          */ 
    95         protected void doCopyOperation(File srcFile, File destFile) 
    96         {        
    97                 Copy copy = new Copy(); 
    98                 copy.setFile(srcFile); 
    99                 copy.setTofile(destFile); 
    100                 copy.execute(); 
    10186        }; 
    10287 
     
    130115 
    131116        /** 
    132          * 圧縮対象外もコピーする必要があるか。 
    133          * @return 
    134          */ 
    135         protected boolean isPermitedCopyOperation(){ 
    136                 return copy; 
    137         }; 
    138  
    139         /** 
    140          * copy用のセッタ 
    141          */ 
    142         public void setCopy(boolean b){ 
    143                 copy = b; 
    144         }; 
    145  
    146         /** 
    147          * copy用のゲッタ 
    148          */ 
    149         public boolean getCopy(){ 
    150                 return copy; 
    151         }; 
    152  
    153         /** 
    154117         * srcDir用のセッタ 
    155118         */ 
    156119        public void setSrcDir(File d){ 
    157120                srcDir = d; 
    158         } 
     121        }; 
    159122 
    160123        /** 
  • lang/java/utiljs/trunk/src/org/coderepos/utiljs/taskdefs/JsDocToolkit.java

    r6802 r7733  
    11package org.coderepos.utiljs.taskdefs; 
    22 
    3 public class JsDocToolkit 
     3// import 
     4import java.io.*; 
     5import org.coderepos.utiljs.Arguments; 
     6 
     7/** 
     8 * JSDoocToolkitをAntから利用する為のクラスです。 
     9 * @author shogo4405 
     10 */ 
     11public class JSDocToolkit 
    412{ 
     13        /** 
     14         * Documentationテンプレート 
     15         */ 
     16        private String template = new String("sunny"); 
    517 
    6 } 
     18        /** 
     19         * 処理内容メッセージ 
     20         */ 
     21        private boolean verbose = false; 
     22 
     23        /** 
     24         * JSDoc出力先ディレクト 
     25         */ 
     26        private File destDir = null; 
     27 
     28        /** 
     29         * 文字コード 
     30         */ 
     31        private String encoding = null; 
     32 
     33        /** 
     34         * 許可する拡張子 
     35         */ 
     36        private String extention = null; 
     37 
     38        public void execute() 
     39        { 
     40                 
     41        }; 
     42 
     43        /** 
     44         * verboseのセッタ 
     45         */ 
     46        public void setVerbose(boolean b){ 
     47                verbose = b; 
     48        }; 
     49 
     50        /** 
     51         * verboseのゲッタ 
     52         */ 
     53        public boolean getVerbose(){ 
     54                return verbose; 
     55        }; 
     56 
     57        /** 
     58         * encodingのセッタ 
     59         */ 
     60        public void setEncoding(String s){ 
     61                encoding = s; 
     62        }; 
     63 
     64        /** 
     65         * encodingのゲッタ 
     66         */ 
     67        public String getEncoding(){ 
     68                return encoding; 
     69        }; 
     70 
     71        /** 
     72         * destDirのセッタ 
     73         */ 
     74        public void setDestDir(File d){ 
     75                destDir = d; 
     76        }; 
     77 
     78        /** 
     79         * destDirのゲッタ 
     80         */ 
     81        public File getDestDir(){ 
     82                return destDir; 
     83        }; 
     84}; 
  • lang/java/utiljs/trunk/src/org/coderepos/utiljs/taskdefs/Yuic.java

    r6802 r7733  
    2121 
    2222        /** メッセージ処理をさせるか? **/ 
    23         private boolean verbose = false; 
     23        private boolean verbose = true; 
    2424 
    2525        /** 1行の文字数 **/ 
     
    5757        protected void doFileOperation(File srcFile, File destFile) 
    5858        { 
    59                 if(!isSuitableFileOperation(srcFile)) 
    60                 { 
    61                         if(isPermitedCopyOperation()) 
    62                         { 
    63                                 createDirectories(destFile); 
    64                                 doCopyOperation(srcFile, destFile); 
    65                         }; 
     59                if(!isSuitableFileOperation(srcFile)){ 
    6660                        return; 
    6761                }; 
  • lang/java/utiljs/trunk/test/testcase.xml

    r6555 r7733  
    99        </target> 
    1010 
     11        <target name="yuic2"> 
     12                <yuic srcDir="test/sample" destDir="result/yuic2" copy="true" /> 
     13        </target> 
     14 
    1115        <!-- All --> 
    12         <target name="all" depends="yuic" /> 
     16        <target name="all" depends="yuic,yuic2" /> 
    1317 
    1418</project>