2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic. 
 
1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  package org.apache.shale.validator.converter;
19  
20  import javax.faces.component.UIComponent;
21  import javax.faces.context.FacesContext;
22  import javax.faces.convert.Converter;
23  import org.apache.shale.validator.util.AbstractUtilities;
24  
25  /***
26   * <p>Abstract base class for converters that use Apache Commons Validator
27   * as their foundation.</p>
28   */
29  public abstract class AbstractConverter extends AbstractUtilities
30    implements Converter {
31      
32  
33      
34  
35  
36      
37  
38  
39      
40  
41  
42      
43  
44  
45      /***
46       * <p>Convert the specified string value, associated with the specified
47       * <code>UIComponent</code>, into a corresponding model data object.</p>
48       *
49       * @param context <code>FacesContext</code> for the current request
50       * @param component <code>UIComponent</code> associated with the
51       *  value to be converted
52       * @param value String value to be converted
53       *
54       * @exception ConverterException if conversion cannot be successfully
55       *  performed
56       * @exception NullPointerException if <code>context</code> or
57       *  <code>component</code> is <code>null</code>
58       */
59      public abstract Object getAsObject(FacesContext context, UIComponent component,
60                                         String value);
61  
62  
63      /***
64       * <p>Convert the specified model data object, associated with the
65       * specified <code>UIComponent</code>, into a string suitable for rendering.</p>
66       *
67       * @param context <code>FacesContext</code> for the current request
68       * @param component <code>UIComponent</code> associated with the
69       *  model data object to be converted
70       * @param value Model data object to be converted
71       *
72       * @exception ConverterException if conversion cannot be successfully
73       *  performed
74       * @exception NullPointerException if <code>context</code> or
75       *  <code>component</code> is <code>null</code>
76       */
77      public abstract String getAsString(FacesContext context, UIComponent component,
78                                         Object value);
79  
80  
81      
82  
83  
84  }