|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectshohaku.shoin.factory.AbstractResourceSetFactory
shohaku.shoin.factory.AbstractIOResourceSetFactory
shohaku.shoin.factory.OgdlProperties
プロパティ値を OGDL式として認識するプロパティセットを格納するファクトリを提供します。
例:
# @ で始まると処理の宣言と見なされます。
@import=java.sql.Time //クラスをOGDLにインポートします。
# $ で始まると、OGDL変数の宣言と為ります。
$sunday="日曜" //sundayが変数名、値をOGDL式として評価
#コメント
season.map={ 1="春", 2="夏", 3="秋", 4="冬" } //プロパティを定義します。キーは文字列、値をOGDL式として評価
コメントや区切り文字等の仕様は java.util.Properties と同等です。
一般的なファイルの読み取りとコンポーネント取得の手順は以下の様に為ります。
OgdlProperties factory = new OgdlProperties();
IOResource inres = FeatureFactory.getLoader().getIOResource("ognl.properties");
factory.setIOResources(new IOResource[] { inres });
ResourceSet resources = factory.getResourceSet();
Map m = (Map) resources.getObject("season.map");
System.out.println("季節名のマッピング=" + m.toString());
>>季節名のマッピング={1=春,2=夏,3=秋,4=冬}
| コンストラクタの概要 | |
OgdlProperties()
プロパティを初期値で初期化します。 |
|
| メソッドの概要 | |
protected java.lang.ClassLoader |
findClassLoader()
使用するクラスローダを検索して返却します。 |
java.lang.ClassLoader |
getClassLoader()
リソースの生成に使用するクラスローダを返却します。 |
java.lang.String |
getPrefix()
全てのリソースに対する接頭辞を返却します。 |
ResourceSet |
getResourceSet()
IOリソースから、リソース集合を生成し返却します。 |
java.lang.String[] |
getSourcesPrefix()
リソース単位での接頭辞の配列を返却します。 |
protected void |
load(java.util.Map lookup,
shohaku.ogdl.OgdlContext context,
java.lang.ClassLoader loader,
shohaku.core.resource.IOResource[] inreses)
IOリソースからリソースを読み込みます。 |
protected void |
load(java.util.Map lookup,
shohaku.ogdl.OgdlContext context,
java.lang.ClassLoader loader,
shohaku.core.resource.IOResource inres,
int index)
IOリソースからリソースを読み込みます。 |
protected java.util.Map |
newResourceSetMap()
リソース集合を格納するマップを生成して返却します。 |
protected ResourceSet |
newResourceSetObject(java.util.Map lookup)
マップからリソース集合を生成して返却します。 |
void |
setClassLoader(java.lang.ClassLoader classLoader)
リソースの生成に使用するクラスローダを格納します。 |
void |
setPrefix(java.lang.String prefix)
全てのリソースに対する接頭辞を格納します。 |
void |
setSourcesPrefix(java.lang.String[] prefixs)
リソース単位での接頭辞の配列を格納します。 |
| クラス shohaku.shoin.factory.AbstractIOResourceSetFactory から継承したメソッド |
getIOResources, setIOResources |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public OgdlProperties()
| メソッドの詳細 |
public ResourceSet getResourceSet()
throws ResourceSetCreationException
IOResourceSetFactory 内の getResourceSetResourceSetCreationException - リソース集合の生成に失敗した場合public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader classLoader)
classLoader - クラスローダprotected java.lang.ClassLoader findClassLoader()
protected java.util.Map newResourceSetMap()
protected ResourceSet newResourceSetObject(java.util.Map lookup)
lookup - リソースを格納するマップ
protected void load(java.util.Map lookup,
shohaku.ogdl.OgdlContext context,
java.lang.ClassLoader loader,
shohaku.core.resource.IOResource[] inreses)
throws ResourceSetCreationException
lookup - リソースを格納するマップloader - クラスローダcontext - 式コンテキストinreses - IOリソースの配列
ResourceSetCreationException - リソース集合の生成に失敗した場合
protected void load(java.util.Map lookup,
shohaku.ogdl.OgdlContext context,
java.lang.ClassLoader loader,
shohaku.core.resource.IOResource inres,
int index)
throws ResourceSetCreationException
lookup - リソースを格納するマップloader - クラスローダcontext - 式コンテキストinres - IOリソースindex - IOリソースのインデックス
ResourceSetCreationException - リソース集合の生成に失敗した場合public java.lang.String getPrefix()
ResourceKeyPrefixSupport の記述:
ResourceKeyPrefixSupport 内の getPrefixpublic void setPrefix(java.lang.String prefix)
ResourceKeyPrefixSupport の記述:
ResourceKeyPrefixSupport 内の setPrefixprefix - 全てのリソースに対する接頭辞public java.lang.String[] getSourcesPrefix()
ResourceKeyPrefixSupport の記述:
ResourceKeyPrefixSupport 内の getSourcesPrefixpublic void setSourcesPrefix(java.lang.String[] prefixs)
ResourceKeyPrefixSupport の記述:
ResourceKeyPrefixSupport 内の setSourcesPrefixprefixs - リソース単位での接頭辞の配列
|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||