|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectshohaku.shoin.factory.AbstractResourceSetFactory
shohaku.shoin.factory.AbstractIOResourceSetFactory
shohaku.shoin.factory.AbstractGinkgoResourceSetFactory
shohaku.shoin.factory.XMLProperties
XMLで定義された、’/’ で区切られた階層名を持つプロパティセットを生成するファクトリを提供します。
例:
<xml-properties> <content> <byte name="byte">-123</byte> <double name="double">+1,521,414.012411</double> <int name="int">100</int> <string name="string">文字列</string> <ns name="foo"> <list id="season" desc="四季"> <string>春</ref> <string>夏</ref> <string>秋</ref> <string>冬</ref> </list> </ns"> </content> </xml-properties>は以下の様に '/' で区切られた名前階層パスにマッピングされ生成されます。
/byte = -123 /double = 1521414.012411 /int = 100 /string = "文字列" /foo/season = ["春", "夏", "秋", "冬"]有効な階層の深さは定義ファイルで変更出来ますが、デフォルトは4階層です。
一般的なファイルの読み取りとコンポーネント取得の手順は以下の様に為ります。 XMLProperties factory = new XMLProperties(); IOResource inres = FeatureFactory.getLoader().getIOResource("properties.xml"); factory.setIOResources(new IOResource[] { inres }); ResourceSet resources = factory.getResourceSet(); List list = (List) resources.getObject("/foo/season"); System.out.println("リスト=" + list.toString()); >>リスト=["春", "夏", "秋", "冬"]
コンストラクタの概要 | |
XMLProperties()
プロパティを初期値で初期化します。 |
メソッドの概要 | |
java.lang.String |
getPrefix()
全てのリソースに対する接頭辞を返却します。 |
java.lang.String[] |
getSourcesPrefix()
リソース単位での接頭辞の配列を返却します。 |
protected void |
initValues(java.util.Map lookup,
shohaku.ginkgo.TagNode root,
int index)
リソースの初期化および登録します。 |
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 |
インタフェース shohaku.shoin.IOResourceSetFactory から継承したメソッド |
getIOResources, setIOResources |
コンストラクタの詳細 |
public XMLProperties()
メソッドの詳細 |
protected void initValues(java.util.Map lookup, shohaku.ginkgo.TagNode root, int index)
AbstractGinkgoResourceSetFactory
の記述:
AbstractGinkgoResourceSetFactory
内の initValues
lookup
- リソースを格納するマップroot
- ルートタグindex
- IOリソースのインデックスpublic java.lang.String getPrefix()
ResourceKeyPrefixSupport
の記述:
ResourceKeyPrefixSupport
内の getPrefix
public void setPrefix(java.lang.String prefix)
ResourceKeyPrefixSupport
の記述:
ResourceKeyPrefixSupport
内の setPrefix
prefix
- 全てのリソースに対する接頭辞public java.lang.String[] getSourcesPrefix()
ResourceKeyPrefixSupport
の記述:
ResourceKeyPrefixSupport
内の getSourcesPrefix
public void setSourcesPrefix(java.lang.String[] prefixs)
ResourceKeyPrefixSupport
の記述:
ResourceKeyPrefixSupport
内の setSourcesPrefix
prefixs
- リソース単位での接頭辞の配列
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |