Class FieldValidationServiceFactory

  extended by project35.soa.validation.FieldValidationServiceFactory

public class FieldValidationServiceFactory
extends java.lang.Object

Provides a singleton pattern for producing registered validation classes. When Project35 reads a schema, it associates field definitions with validation classes. It chooses the validation class based on the XML Schema variable type: xs:string, xs:integer, xs:float, etc. After a schema is parsed, Project35 has a collection of record factories. Each factory has a collection of fields which may each be associated with one or more validation objects. When the factory is cloned, new validation objects are created. It is unnecessary to have multiple objects created for validation classes which have no parameters. for example, a hundred Integer validator objects will all do exactly the same thing. However, a hundred BoundedInteger validator objects might have different behaviours because each object may have different upper and lower bounds. So this class is used to cut down on the proliferation of validation objects.

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 (

Constructor Summary
FieldValidationServiceFactory(Project35ApplicationContext project35ApplicationContext)
Method Summary
 FieldValidationService createFieldValidationService(java.lang.Class fieldValidationServiceClass, boolean isPersistent)
 FieldValidationService createFieldValidationService(java.lang.Class fieldValidationServiceClass, Parameter[] parameters, boolean isPersistent)
static FieldValidationServiceFactory getFactory()
static void setProject35ApplicationContext(Project35ApplicationContext _project35ApplicationContext)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public FieldValidationServiceFactory(Project35ApplicationContext project35ApplicationContext)
Method Detail


public static FieldValidationServiceFactory getFactory()


public static void setProject35ApplicationContext(Project35ApplicationContext _project35ApplicationContext)


public FieldValidationService createFieldValidationService(java.lang.Class fieldValidationServiceClass,
                                                           Parameter[] parameters,
                                                           boolean isPersistent)
                                                    throws java.lang.Exception


public FieldValidationService createFieldValidationService(java.lang.Class fieldValidationServiceClass,
                                                           boolean isPersistent)
                                                    throws java.lang.Exception