| java.lang.Object org.iscreen.ValidationFactory org.iscreen.impl.xml.XmlServiceFactory
All known Subclasses: org.iscreen.mvel.MvelXmlServiceFactory, org.iscreen.ognl.OgnlXmlServiceFactory,
XmlServiceFactory | abstract public class XmlServiceFactory extends ValidationFactory (Code) | | This is a base class used by the parser for registering configuration
events with a ValidationFactory. It's meant to be subclassed by
a service factory that understands the XML configuration file and
can construct the internal configuration of it.
author: Shellman, Dan |
Method Summary | |
abstract public void | addValidationSetToSet(String setId, String setRefId, boolean failFastFlag, String name, String ifExp, String iterateExp, String mapExp) Adds a validation set reference call to a validation set. | abstract public void | addValidatorToSet(String setId, String globalDefaultResource, String defaultResource, String validatorRef, boolean failFastFlag, String validatorName, XmlConfigLabel label, XmlConfigDoc doc, Set mappings, Set constraints, Set failures) Adds a 'use-validator' to a Validation Set. | public ConfiguredResource | getResource(String id) Retrieves a ConfiguredResource for the given id. | public ConfiguredResource | getResource(String id1, String id2, String id3) Retrieves a resource based upon a set of id's. | public ValidationService | getValidationService(String serviceName) Retrieves a validation service with the given service name.
Parameters: serviceName - The name of the validation service. | protected void | loadConfig() Called to initialize the configuration (loads the XML config file). | public void | registerInclude(String location) Registers an included file (for parsing). | public void | registerResource(String id, String ref, Set messages, Set resourceFiles) Registers a resource with its id (and parent ref, if there is one),
hard-coded messages, and resource bundle locations. | public void | registerService(String serviceId, Object service) Registers a service with the factory. | abstract public void | registerValidationSet(String id) Registers a Validation Set. | abstract public void | registerValidator(String globalDefaultResource, String id, String ref, String className, String defaultResource, XmlConfigLabel label, XmlConfigDoc doc, Set mappings, Set constraints, Set failures) Registers an individual Validator configuration. |
XmlServiceFactory | public XmlServiceFactory()(Code) | | Default constructor.
|
addValidationSetToSet | abstract public void addValidationSetToSet(String setId, String setRefId, boolean failFastFlag, String name, String ifExp, String iterateExp, String mapExp)(Code) | | Adds a validation set reference call to a validation set.
Parameters: setId - The id of the containing Validation Set. Parameters: setRefId - The id of the Validation Set being referenced. Parameters: failFastFlag - Whether to continue validations if the setreports a failure. Parameters: ifExp - Whether to execute the validations in the referenced set. Parameters: iterateExp - Whether to iterate over the objects being mappedand validate each one. Parameters: mapExp - The mapping expression. |
addValidatorToSet | abstract public void addValidatorToSet(String setId, String globalDefaultResource, String defaultResource, String validatorRef, boolean failFastFlag, String validatorName, XmlConfigLabel label, XmlConfigDoc doc, Set mappings, Set constraints, Set failures)(Code) | | Adds a 'use-validator' to a Validation Set. The 'use-validator' must
reference a Validator.
Parameters: setId - The Validation Set id. Parameters: globalDefaultResource - The configuration file's default resource(can be null/empty). Parameters: defaultResource - The Validation Set's default resource (optional). Parameters: validatorRef - The reference to a Validator (required). Parameters: failFastFlag - Whether to stop validations if this validator fails. Parameters: label - The label for this validator. Parameters: doc - The documentation for this validator. Parameters: mappings - The mappings for this validator. Parameters: constraints - The constraints for this validator. Parameters: failures - The failures for this validator. |
getResource | public ConfiguredResource getResource(String id)(Code) | | Retrieves a ConfiguredResource for the given id. If no resource
exists with that id, then a blank one is created and returned.
Parameters: id - The id of the resource Returns a ConfiguredResource for the given id. |
getResource | public ConfiguredResource getResource(String id1, String id2, String id3)(Code) | | Retrieves a resource based upon a set of id's. If the 'id1' is a
valid resource id, then return that one. If not, and 'id2' is a valid
resource id, then return that one. If not, and 'id3' is a valid
resource id, then return that one. If none of the id's are valid,
then throw an exception.
Parameters: id1 - The first resource id to look for. Parameters: id2 - The second resource id to look for. Parameters: id3 - The third resource id to look for. Returns the ConfiguredResource of the first valid resource id. |
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) | | Called to initialize the configuration (loads the XML config file).
|
registerInclude | public void registerInclude(String location)(Code) | | Registers an included file (for parsing). The location defines
a classpath-based location of the XML file.
Parameters: location - The location of the XML file. |
registerResource | public void registerResource(String id, String ref, Set messages, Set resourceFiles)(Code) | | Registers a resource with its id (and parent ref, if there is one),
hard-coded messages, and resource bundle locations. Note that the
Set of messages and resource files MUST NOT be null (if there are
none, just pass in an empty Set).
Parameters: id - The unique id of the resource. Parameters: ref - The unique id of the parent resource this resource is referencing. Parameters: messages - Set of XmlConfigMessage objects (can't be null) Parameters: resourceFiles - Set of Strings representing resource bundle locations. |
registerService | public void registerService(String serviceId, Object service)(Code) | | Registers a service with the factory. This service can then be
referenced by validators via configuration.
Parameters: serviceId - The service id Parameters: service - The service |
registerValidationSet | abstract public void registerValidationSet(String id)(Code) | | Registers a Validation Set.
Parameters: id - The validation set's unique id. |
registerValidator | abstract public void registerValidator(String globalDefaultResource, String id, String ref, String className, String defaultResource, XmlConfigLabel label, XmlConfigDoc doc, Set mappings, Set constraints, Set failures)(Code) | | Registers an individual Validator configuration. This will create
a configured Validator that can be referenced by other Validators or
by adding a Validator to a Validation Set.
Parameters: globalDefaultResource - The resource id, when all else fails. Parameters: id - The unique id of the Validator Parameters: ref - The unique id of the Validator this Validator references.This can be null and is optional. Parameters: className - The class name of the Validator (optional, but ifthere MUST be a valid ref). Parameters: defaultResource - The resource id if no id is defined locally. Parameters: label - The Label for the Validator. This is optional. Parameters: doc - The documentation for the Validator. This is optional. Parameters: mappings - The Set of mappings (can't be null, but can be empty). Parameters: constraints - The Set of constraints (can't be null, but can be empty). Parameters: failures - The Set of failures (can't be null, but can be empty). |
|
|