org.formaria.editor.project.validation
Class EditorValidationFactory

java.lang.Object
  extended by org.formaria.aria.validation.ValidationFactory
      extended by org.formaria.editor.project.validation.EditorValidationFactory

public class EditorValidationFactory
extends ValidationFactory

Copyright: Copyright (c) Formaria Ltd., 1998-2003

$Revision: 1.1 $


Field Summary
 
Fields inherited from class org.formaria.aria.validation.ValidationFactory
changeCounter, configFiles, currentProject, localChangeCounter, validations
 
Constructor Summary
EditorValidationFactory(EditorProject project)
           
 
Method Summary
 XmlElement getValidation(java.lang.String name)
           
 Validator getValidation(java.lang.String validationName, int mask, java.lang.Object page)
          Gets the validation for the validationName.
 Validator getValidation(java.lang.String validationName, java.lang.reflect.Method m, int mask, java.lang.Object page, XmlElement instanceConfig)
          Creates an Validation object which validates against a value returned from a function call
 java.lang.String[] getValidations()
           
 
Methods inherited from class org.formaria.aria.validation.ValidationFactory
addConfigFile, checkRegistration, doRead, doRead, doRead, getValidation, read, read, read, updateConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorValidationFactory

public EditorValidationFactory(EditorProject project)
Method Detail

getValidations

public java.lang.String[] getValidations()

getValidation

public XmlElement getValidation(java.lang.String name)

getValidation

public Validator getValidation(java.lang.String validationName,
                               java.lang.reflect.Method m,
                               int mask,
                               java.lang.Object page,
                               XmlElement instanceConfig)
Creates an Validation object which validates against a value returned from a function call

Overrides:
getValidation in class ValidationFactory
Parameters:
validationName - The name of the validation
m - The Method to call in order to get the value to validate against
mask - The event mask to be applied to the validation
page - The page object which contains the function
instanceConfig - the XML element which is declared in the page
Returns:
The new Validator

getValidation

public Validator getValidation(java.lang.String validationName,
                               int mask,
                               java.lang.Object page)
Gets the validation for the validationName. Checks first to see if the validation is a predefined type in which case it reads it's required attributes. If the validation type is custom we just need to create a validator from the class attribute

Parameters:
page - The page object which contains the function
validationName - The name of the validation
mask - The event mask to be applied to the validation
Returns:
The new Validator