Class Choose1FromNValidator

  extended by project35.soa.validation.AbstractEditFieldValidationService
      extended by project35.soa.validation.Choose1FromNValidator
All Implemented Interfaces:, ServiceClass, ConstraintDescription, EditFieldValidationService, FieldValidationService

public class Choose1FromNValidator
extends AbstractEditFieldValidationService
implements ConstraintDescription

This class is used for combination box fields that have a "None" option. The class checks whether a required combination field value is "None". The actual string "None" is defined by Project35Resources's globalConstants.none

Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.

Kevin Garwood (
See Also:
Serialized Form

Field Summary
Fields inherited from class project35.soa.validation.AbstractEditFieldValidationService
Constructor Summary
Choose1FromNValidator(java.lang.String[] choices)
Method Summary
 java.lang.String getConstraintsDescription()
 void setChoices(java.lang.String[] choices)
 java.util.ArrayList validate(Project35FormContext project35FormContext, java.lang.String value)
          validates the field value and returns any error messages
Methods inherited from class project35.soa.validation.AbstractEditFieldValidationService
getFieldName, getInitialisationParameters, initialiseService, isEmpty, isFieldRequired, setFieldName, setRequiredField, validateRequiredField
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Choose1FromNValidator(java.lang.String[] choices)

choices - the choices available in the combination box field


public Choose1FromNValidator()
Method Detail


public void setChoices(java.lang.String[] choices)


public java.lang.String getConstraintsDescription()
Specified by:
getConstraintsDescription in interface ConstraintDescription


public java.util.ArrayList validate(Project35FormContext project35FormContext,
                                    java.lang.String value)
Description copied from interface: EditFieldValidationService
validates the field value and returns any error messages

Specified by:
validate in interface EditFieldValidationService
Specified by:
validate in class AbstractEditFieldValidationService
value - the value of the field
a collection of Alert instances that represent errors,warnings,points of information or requests for more information if no errors were found