shohaku.shoin.factory
クラス ConstantsProperties

java.lang.Object
  拡張shohaku.shoin.factory.AbstractResourceSetFactory
      拡張shohaku.shoin.factory.AbstractObjectResourceSetFactory
          拡張shohaku.shoin.factory.ConstantsProperties
すべての実装インタフェース:
ObjectResourceSetFactory, ResourceKeyPrefixSupport, ResourceSetFactory

public class ConstantsProperties
extends AbstractObjectResourceSetFactory
implements ResourceKeyPrefixSupport

指定されたクラスのパブリックな定数(public static final なフィールド)をプロパティセットとして生成するファクトリを提供します。
基となるオブジェクトがクラス型の場合はそのまま使用されます、以外の場合はそのオブジェクトのクラス型が使用されます。

例:

 一般的なファイルの読み取りとコンポーネント取得の手順は以下の様に為ります。 
 ConstantsProperties factory = new ConstantsProperties();
 factory.setSources(new Object[] { Integer.class });
 
 ResourceSet resources = factory.getResourceSet();

 Integer max = (Integer) resources.getObject("MAX_VALUE");
 System.out.println("int の最大値=" + max);

 >>int の最大値=2147483647
 


コンストラクタの概要
ConstantsProperties()
          プロパティを初期値で初期化します。
 
メソッドの概要
 java.lang.String getPrefix()
          全てのリソースに対する接頭辞を返却します。
 ResourceSet getResourceSet()
          リソース集合を生成し返却します。
 java.lang.String[] getSourcesPrefix()
          リソース単位での接頭辞の配列を返却します。
 void setPrefix(java.lang.String prefix)
          全てのリソースに対する接頭辞を格納します。
 void setSourcesPrefix(java.lang.String[] prefixs)
          リソース単位での接頭辞の配列を格納します。
 
クラス shohaku.shoin.factory.AbstractObjectResourceSetFactory から継承したメソッド
getSources, setSources
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ConstantsProperties

public ConstantsProperties()
プロパティを初期値で初期化します。

メソッドの詳細

getResourceSet

public ResourceSet getResourceSet()
                           throws ResourceSetCreationException
インタフェース ResourceSetFactory の記述:
リソース集合を生成し返却します。

定義:
インタフェース ResourceSetFactory 内の getResourceSet
戻り値:
リソース集合
例外:
ResourceSetCreationException - リソース集合の生成に失敗した場合

getPrefix

public java.lang.String getPrefix()
インタフェース ResourceKeyPrefixSupport の記述:
全てのリソースに対する接頭辞を返却します。

定義:
インタフェース ResourceKeyPrefixSupport 内の getPrefix
戻り値:
全てのリソースに対する接頭辞

setPrefix

public void setPrefix(java.lang.String prefix)
インタフェース ResourceKeyPrefixSupport の記述:
全てのリソースに対する接頭辞を格納します。

定義:
インタフェース ResourceKeyPrefixSupport 内の setPrefix
パラメータ:
prefix - 全てのリソースに対する接頭辞

getSourcesPrefix

public java.lang.String[] getSourcesPrefix()
インタフェース ResourceKeyPrefixSupport の記述:
リソース単位での接頭辞の配列を返却します。

定義:
インタフェース ResourceKeyPrefixSupport 内の getSourcesPrefix
戻り値:
リソース単位での接頭辞の配列

setSourcesPrefix

public void setSourcesPrefix(java.lang.String[] prefixs)
インタフェース ResourceKeyPrefixSupport の記述:
リソース単位での接頭辞の配列を格納します。

定義:
インタフェース ResourceKeyPrefixSupport 内の setSourcesPrefix
パラメータ:
prefixs - リソース単位での接頭辞の配列