|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.iscreen.ValidationFactory
org.iscreen.impl.xml.XmlServiceFactory
public abstract class XmlServiceFactory
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.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_META
|
protected java.util.Map |
metaMap
|
protected int |
parseCount
|
protected java.util.Set |
parsedDocuments
|
protected java.util.Map |
resourceMap
|
protected java.util.Map |
setMap
|
protected java.util.Map |
validatorMap
|
Fields inherited from class org.iscreen.ValidationFactory |
---|
configLocation, defaultLocale, FACTORY_DEFAULT_XML, FACTORY_MVEL_XML, FACTORY_OGNL_XML, serviceMap |
Constructor Summary | |
---|---|
XmlServiceFactory()
Default constructor. |
Method Summary | |
---|---|
void |
addMetaToValidationSet(java.lang.String setId,
java.lang.String propertyName,
java.lang.String metaValue)
Adds meta information about a validation set. |
abstract void |
addValidationSetToSet(java.lang.String setId,
java.lang.String setRefId,
boolean failFastFlag,
java.lang.String name,
java.lang.String ifExp,
java.lang.String iterateExp,
java.lang.String mapExp)
Adds a validation set reference call to a validation set. |
abstract void |
addValidatorToSet(java.lang.String setId,
java.lang.String globalDefaultResource,
java.lang.String defaultResource,
java.lang.String validatorRef,
boolean failFastFlag,
java.lang.String validatorName,
java.lang.String ifExp,
XmlConfigLabel label,
XmlConfigDoc doc,
java.util.Set mappings,
java.util.Set constraints,
java.util.Set failures)
Adds a 'use-validator' to a Validation Set. |
void |
endParse()
Decrements the parse count |
ConfiguredResource |
getResource(java.lang.String id)
Retrieves a ConfiguredResource for the given id. |
ConfiguredResource |
getResource(java.lang.String id1,
java.lang.String id2,
java.lang.String id3)
Retrieves a resource based upon a set of id's. |
ValidationService |
getValidationService(java.lang.String serviceName)
Retrieves a validation service with the given service name. |
ValidationService |
getValidationService(java.lang.String metaPropertyName,
java.lang.String metaValue)
Retrieves a validation service with the given meta property and value. |
protected DefaultValidationService |
getValidationSet(java.lang.String refId)
Retrieves a DefaultValidationService with the given id. |
protected void |
loadConfig()
Called to initialize the configuration (loads the XML config file). |
void |
registerInclude(java.lang.String location)
Registers an included file (for parsing). |
void |
registerResource(java.lang.String id,
java.lang.String ref,
java.util.Set messages,
java.util.Set resourceFiles)
Registers a resource with its id (and parent ref, if there is one), hard-coded messages, and resource bundle locations. |
void |
registerService(java.lang.String serviceId,
java.lang.Object service)
Registers a service with the factory. |
abstract void |
registerValidationSet(java.lang.String id)
Registers a Validation Set. |
abstract void |
registerValidator(java.lang.String globalDefaultResource,
java.lang.String id,
java.lang.String ref,
java.lang.String className,
java.lang.String defaultResource,
XmlConfigLabel label,
XmlConfigDoc doc,
java.util.Set mappings,
java.util.Set constraints,
java.util.Set failures)
Registers an individual Validator configuration. |
void |
startParse()
Increments the parse count |
Methods inherited from class org.iscreen.ValidationFactory |
---|
buildFactory, buildFactory, getConfigLocation, getDefaultLocale, getServices, registerFactory, setConfigLocation, setDefaultLocale, setServices |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_META
protected java.util.Map resourceMap
protected java.util.Map validatorMap
protected java.util.Map setMap
protected java.util.Map metaMap
protected java.util.Set parsedDocuments
protected int parseCount
Constructor Detail |
---|
public XmlServiceFactory()
Method Detail |
---|
public ValidationService getValidationService(java.lang.String serviceName)
getValidationService
in class ValidationFactory
serviceName
- The name of the validation service.
public ValidationService getValidationService(java.lang.String metaPropertyName, java.lang.String metaValue)
getValidationService
in class ValidationFactory
metaPropertyName
- The meta name or id (i.e. className).metaValue
- The value of the meta data (i.e. com.something.someBean)
public void registerResource(java.lang.String id, java.lang.String ref, java.util.Set messages, java.util.Set resourceFiles)
id
- The unique id of the resource.ref
- The unique id of the parent resource this resource is referencing.messages
- Set of XmlConfigMessage objects (can't be null)resourceFiles
- Set of Strings representing resource bundle locations.public void registerInclude(java.lang.String location)
location
- The location of the XML file.public abstract void registerValidator(java.lang.String globalDefaultResource, java.lang.String id, java.lang.String ref, java.lang.String className, java.lang.String defaultResource, XmlConfigLabel label, XmlConfigDoc doc, java.util.Set mappings, java.util.Set constraints, java.util.Set failures)
globalDefaultResource
- The resource id, when all else fails.id
- The unique id of the Validatorref
- The unique id of the Validator this Validator references.
This can be null and is optional.className
- The class name of the Validator (optional, but if
there MUST be a valid ref).defaultResource
- The resource id if no id is defined locally.label
- The Label for the Validator. This is optional.doc
- The documentation for the Validator. This is optional.mappings
- The Set of mappings (can't be null, but can be empty).constraints
- The Set of constraints (can't be null, but can be empty).failures
- The Set of failures (can't be null, but can be empty).public abstract void registerValidationSet(java.lang.String id)
id
- The validation set's unique id.public void addMetaToValidationSet(java.lang.String setId, java.lang.String propertyName, java.lang.String metaValue)
setId
- The validation set id.propertyName
- The name or id of the meta tag.metaValue
- The value of the meta information.public abstract void addValidatorToSet(java.lang.String setId, java.lang.String globalDefaultResource, java.lang.String defaultResource, java.lang.String validatorRef, boolean failFastFlag, java.lang.String validatorName, java.lang.String ifExp, XmlConfigLabel label, XmlConfigDoc doc, java.util.Set mappings, java.util.Set constraints, java.util.Set failures)
setId
- The Validation Set id.globalDefaultResource
- The configuration file's default resource
(can be null/empty).defaultResource
- The Validation Set's default resource (optional).validatorRef
- The reference to a Validator (required).failFastFlag
- Whether to stop validations if this validator fails.validatorName
- The name of the validator.ifExp
- The 'if' expression on whether to execute this validator or not.label
- The label for this validator.doc
- The documentation for this validator.mappings
- The mappings for this validator.constraints
- The constraints for this validator.failures
- The failures for this validator.public abstract void addValidationSetToSet(java.lang.String setId, java.lang.String setRefId, boolean failFastFlag, java.lang.String name, java.lang.String ifExp, java.lang.String iterateExp, java.lang.String mapExp)
setId
- The id of the containing Validation Set.setRefId
- The id of the Validation Set being referenced.failFastFlag
- Whether to continue validations if the set
reports a failure.ifExp
- Whether to execute the validations in the referenced set.iterateExp
- Whether to iterate over the objects being mapped
and validate each one.mapExp
- The mapping expression.public void registerService(java.lang.String serviceId, java.lang.Object service)
serviceId
- The service idservice
- The servicepublic ConfiguredResource getResource(java.lang.String id)
id
- The id of the resource
public ConfiguredResource getResource(java.lang.String id1, java.lang.String id2, java.lang.String id3)
id1
- The first resource id to look for.id2
- The second resource id to look for.id3
- The third resource id to look for.
protected void loadConfig()
loadConfig
in class ValidationFactory
public void startParse()
public void endParse()
protected DefaultValidationService getValidationSet(java.lang.String refId)
DefaultValidationService
with the given id. If one has not
been previously registered, then create a blank one.
id
- The Validation Set id.
DefaultValidationService
with the given id.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |