info.informatica.util.locale
Class ResourceFactory

java.lang.Object
  extended by info.informatica.util.locale.ResourceFactory
Direct Known Subclasses:
FileResourceFactory, LoaderResourceFactory

public abstract class ResourceFactory
extends Object

Factory of localized objects.

Loads objects according to basename, extension and locale name.

Version:
1.00
Author:
amengual at informatica dot info

Constructor Summary
ResourceFactory()
           
ResourceFactory(Associator assoc)
           
 
Method Summary
abstract  InputStream loadLocalFile(String baseFileName, String ext, String localeName)
           
 Object loadLocalObject(String baseFileName, String ext, String localeName, Locale locale)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFactory

public ResourceFactory()

ResourceFactory

public ResourceFactory(Associator assoc)
Method Detail

loadLocalObject

public Object loadLocalObject(String baseFileName,
                              String ext,
                              String localeName,
                              Locale locale)
                       throws IOException
Parameters:
baseFileName - the basename of the path
ext - the extension.
localeName - the name of the locale, including the initial '.', eg. ".es_ES".
locale - the Locale. Both the locale and the locale name are supplied, to avoid the overhead of building the locale name several times.
Returns:
the newly instantiated object, or the inputstream if could not instantiate the object, or null if no inputstream could be opened
Throws:
IOException

loadLocalFile

public abstract InputStream loadLocalFile(String baseFileName,
                                          String ext,
                                          String localeName)
                                   throws IOException
Parameters:
baseFileName - the basename of the path
ext - the extension.
localeName - the name of the locale, eg. es_ES.
Throws:
IOException