KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > validation > ValidationManagerFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * ValidationManagerFactory.java August 18, 2003, 3:50 PM
26  *
27  */

28
29 package com.sun.enterprise.tools.common.validation;
30
31 import com.sun.enterprise.tools.common.validation.util.ObjectFactory;
32 import com.sun.enterprise.tools.common.validation.ValidationManager;
33
34
35 /**
36  * ValidationManagerFactory is a factory to create {@link ValidationManager}
37  * objects. Creates <code>ValidationManager</code> based on the given Validation
38  * File.
39  *
40  * @see ValidationManager
41  *
42  * @author Rajeshwar Patil
43  * @version %I%, %G%
44  */

45
46 public class ValidationManagerFactory {
47     /* A class implementation comment can go here. */
48
49     /** Creates a new instance of <code>ValidationManagerFactory</code> */
50     public ValidationManagerFactory(){
51     }
52
53
54     /**
55      * Creates default Validation Manager.
56      * Default Validation Manager is created using default Validation File
57      *
58      * @return <code>ValidationManager</code> the default Validation Manager.
59      *
60      */

61     public ValidationManager getValidationManager(){
62         return (ValidationManager) ObjectFactory.newInstance(
63             "com.sun.enterprise.tools.common.validation." + //NOI18N
64
"ValidationManager"); //NOI18N
65
}
66
67
68     /**
69      * Creates Validation Manager based on the given Validation File.
70      *
71      * @param validationFile the Validation File. Validation File specifies
72      * Validation rules(which Constraints to apply to which elements).
73      *
74      * @return <code>ValidationManager</code> the Validation Manager based on
75      * the given Validation File.
76      */

77     public ValidationManager getValidationManager(String JavaDoc validationFile){
78         return (ValidationManager) ObjectFactory.newInstance(
79             "com.sun.enterprise.tools.common.validation." + //NOI18N
80
"ValidationManager", validationFile); //NOI18N
81
}
82 }
83
Popular Tags