| java.lang.Object org.iscreen.ValidationFactory
All known Subclasses: org.iscreen.impl.xml.XmlServiceFactory, org.iscreen.MockValidationFactory,
ValidationFactory | public class ValidationFactory (Code) | | This class represents factories that can generate validation services from
configuration files (or however the factory generates them). The
static portion of this factory implementation is thread-safe.
author: Shellman, Dan |
FACTORY_DEFAULT_XML | final public static String FACTORY_DEFAULT_XML(Code) | | |
FACTORY_MVEL_XML | final public static String FACTORY_MVEL_XML(Code) | | |
FACTORY_OGNL_XML | final public static String FACTORY_OGNL_XML(Code) | | |
ValidationFactory | protected ValidationFactory()(Code) | | Protected constructor. In general, validation factories shouldn't
be constructed directly (hence the need to register them, etc.).
|
buildFactory | public static ValidationFactory buildFactory(String factoryId, String configLocation, Locale theDefaultLocale, Map services)(Code) | | Builds a registered factory. The factory is tied to the
configuration type (such as XML, etc.). Pre-defined factories
(constants defined as FACTORY_xxx) are always available.
Parameters: factoryId - The id of the factory to retrieve. Parameters: configLocation - Classpath location of the configuration Parameters: theDefaultLocale - The default locale Parameters: services - Services that are necessary for the factory Returns a ValidationFactory. If none exist with the givenid, then a runtime exception is thrown. |
buildFactory | public static ValidationFactory buildFactory(String factoryId, String configLocation, Map services)(Code) | | Builds a registered factory. The factory is tied to the
configuration type (such as XML, etc.). Pre-defined factories
(constants defined as FACTORY_xxx) are always available.
Parameters: factoryId - The id of the factory to retrieve. Parameters: configLocation - Classpath location of the configuration Parameters: services - Services that are necessary for the factory Returns a ValidationFactory. If none exist with the givenid, then a runtime exception is thrown. |
getConfigLocation | protected String getConfigLocation()(Code) | | Retrieves the configuration file location for this validation factory.
Returns the location of the config file. This may be null. |
getDefaultLocale | protected Locale getDefaultLocale()(Code) | | Retrieves the default locale for this factory.
Returns the default locale for this factory. |
getServices | protected Map getServices()(Code) | | Retrieves the map of services available to this factory.
Returns the map of services. |
getValidationService | public ValidationService getValidationService(String serviceName)(Code) | | Retrieves a validation service with the given service name.
Parameters: serviceName - The name of the validation service. Returns the validation service with the given name. |
loadConfig | protected void loadConfig()(Code) | | This method is called to initialize the factory. It is called after
the services and configuration location have been set. After this
call, the factory should be in a state that it can retrieve
validation services.
|
registerFactory | public static void registerFactory(Class factoryClass, String factoryId)(Code) | | Registers a factory with a given factory id. Use this method to
register a custom-built factory. If a factory of the given id already
exists, it will be replaced.
Parameters: factoryClass - The class of the factory to register Parameters: factoryId - The id of the factory (used to retrieve it later) |
setConfigLocation | protected void setConfigLocation(String location)(Code) | | This is called right after the validation factory is instantiated
and the services call (setServices()) has been called. This method
informs the factory of the config file that will be used. If it's not
in the format that the factory expects, the factory should throw an
unchecked exception.
Parameters: location - The location of the configuration file for the factory.The location is classpath-based. |
setDefaultLocale | protected void setDefaultLocale(Locale locale)(Code) | | Sets the default locale for this factory.
Parameters: locale - The default locale for this factory. |
setServices | protected void setServices(Map theServices)(Code) | | This is called right after the validation factory is instantiated.
This map of services is meant to provide the factory with additional,
external services that the factory can make available to validation
services.
Parameters: theServices - The services to provide to the factory. |
|
|