KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > formview > validator > ExtendedValidatorResources


1 package net.sourceforge.formview.validator;
2
3 import java.io.IOException JavaDoc;
4 import java.io.InputStream JavaDoc;
5 import java.util.Collection JavaDoc;
6 import java.util.Iterator JavaDoc;
7 import java.util.List JavaDoc;
8
9 import org.apache.commons.validator.FormSet;
10 import org.apache.commons.validator.ValidatorResources;
11 import org.xml.sax.SAXException JavaDoc;
12
13 /**
14  * Description : Validator extended in order to get formset of validator.
15  * @version 1.0.0
16  * @author <a HREF="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
17  *
18  */

19 public class ExtendedValidatorResources extends ValidatorResources{
20
21     private static final long serialVersionUID = 1L;
22     
23     public ExtendedValidatorResources(InputStream JavaDoc in)
24     throws IOException JavaDoc, SAXException JavaDoc{
25         super(in);
26     }
27     
28     public ExtendedValidatorResources(InputStream JavaDoc[] in)
29     throws IOException JavaDoc, SAXException JavaDoc{
30         super(in);
31     }
32     
33     public FormSet getFormSet() {
34         if (hFormSets != null) {
35             Collection JavaDoc formSetList = hFormSets.values();
36             if (formSetList != null) {
37                 for (Iterator JavaDoc iter = formSetList.iterator(); iter.hasNext();) {
38                     List JavaDoc formsets = (List JavaDoc) iter.next();
39                     return (FormSet)formsets.get(0);
40                 }
41             }
42         }
43         return null;
44     }
45 }
46
Popular Tags