001/* 002 * Copyright (c) 2009 The openGion Project. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 013 * either express or implied. See the License for the specific language 014 * governing permissions and limitations under the License. 015 */ 016package org.opengion.fukurou.util; 017 018import java.io.File; 019 020/** 021 * HybsLoaderを生成するための、設定情報を管理するためのクラスです。 022 * 023 * @og.rev 5.1.1.0 (2009/12/01) 新規作成 024 * @og.group 業務ロジック 025 * 026 * @version 5.0 027 * @author Hiroki Nakamura 028 * @since JDK1.6, 029 */ 030public class HybsLoaderConfig { 031 private final String srcDir; 032 private final String classDir; 033// private final boolean isAutoCompile; 034// private final boolean isHotDeploy; 035 private final boolean useAutoCompile; // 5.1.8.0 (2010/07/01) メソッド名と同じフィールド名なので、変更 036 private final boolean useHotDeploy; // 5.1.8.0 (2010/07/01) メソッド名と同じフィールド名なので、変更 037 private final String classPath; 038 039 /** 040 * ソースディレクトリとクラスディレクトリのみを指定し、HybsLoaderの設定情報を構築します。 041 * この場合、AutoCompile機能、HotDeploy機能は無効になります。 042 * 043 * @param sDir ソースディレクトリ 044 * @param cDir クラスディレクトリ 045 */ 046// public HybsLoaderConfig( final String sDir, final String cDir, final boolean isDebug ) { 047 public HybsLoaderConfig( final String sDir, final String cDir ) { 048 this( sDir, cDir, false, false, null ); 049 } 050 051 /** 052 * HybsLoaderの設定情報を構築します。 053 * 054 * @param sDir ソースディレクトリ 055 * @param cDir クラスディレクトリ 056 * @param acom AutoCompile機能を有効にするか 057 * @param hdep HotDeploy機能を有効にするか 058 * @param clsPath コンパイル時のクラスパス 059 */ 060 public HybsLoaderConfig( final String sDir, final String cDir 061 ,final boolean acom, final boolean hdep, final String clsPath ) { 062 srcDir = sDir.charAt( sDir.length() -1 ) == File.separatorChar ? sDir : sDir + File.separator; 063 classDir = cDir.charAt( cDir.length() -1 ) == File.separatorChar ? cDir : cDir + File.separator; 064 065 useAutoCompile = acom; 066 useHotDeploy = hdep; 067 classPath = clsPath; 068 } 069 070 /** 071 * ソースディレクトリを取得します。 072 * 073 * @return ソースディレクトリ 074 */ 075 public String getSrcDir() { 076 return srcDir; 077 } 078 079 /** 080 * クラスディレクトリを取得します。 081 * 082 * @return クラスディレクトリ 083 */ 084 public String getClassDir() { 085 return classDir; 086 } 087 088 /** 089 * AutoCompileが有効化どうかを取得します。 090 * 091 * @return AutoCompileが有効か 092 */ 093 public boolean isAutoCompile() { 094 return useAutoCompile; 095 } 096 097 /** 098 * HotDeployが有効化どうかを取得します。 099 * 100 * @return HotDeployが有効か 101 */ 102 public boolean isHotDeploy() { 103 return useHotDeploy; 104 } 105 106 /** 107 * コンパイルのためのクラスパスを返します。 108 * コンストラクタで複数のクラスパスが指定された場合、 109 * ここで返されるクラスパスは、';'区切りのクラスパスになります。 110 * 111 * @return クラスパス 112 */ 113 public String getClassPath() { 114 return classPath; 115 } 116}