org.apache.myfaces.commons.converter
Class BooleanConverter
java.lang.Object
   org.apache.myfaces.commons.converter.BooleanConverter
org.apache.myfaces.commons.converter.BooleanConverter
- All Implemented Interfaces: 
- javax.faces.component.StateHolder, javax.faces.convert.Converter
- @JSFConverter(name="mcc:convertBoolean",
              tagClass="org.apache.myfaces.commons.converter.ConvertBooleanTag",
              serialuidtag="-6004262065580818687L")
public class BooleanConverter
- extends java.lang.Object- implements javax.faces.convert.Converter, javax.faces.component.StateHolder
Converter that translates between boolean values (true/false)
 and alternate versions of those boolean values like
 (yes/no), (1/0), and (way/no way).
 
 To customize the representation of a boolean true and false,
 use setTrueValue(String)
 and setFalseValue(String)
 respectively.  If  not configured with these setter methods,
 it defaults to true and false.
 
 The values are case sensitive.
 
- Author:
- Ken Weiner
 
 
| Method Summary | 
|  java.lang.Object | getAsObject(javax.faces.context.FacesContext facesContext,
            javax.faces.component.UIComponent uiComponent,
            java.lang.String value)
 | 
|  java.lang.String | getAsString(javax.faces.context.FacesContext facesContext,
            javax.faces.component.UIComponent uiComponent,
            java.lang.Object value)
 | 
|  java.lang.String | getFalseValue()Value representing a boolean false, e.g.
 | 
|  java.lang.String | getTrueValue()Value representing a boolean true, e.g.
 | 
|  boolean | isTransient()
 | 
|  void | restoreState(javax.faces.context.FacesContext context,
             java.lang.Object state)
 | 
|  java.lang.Object | saveState(javax.faces.context.FacesContext context)
 | 
|  void | setFalseValue(java.lang.String falseValue)
 | 
|  void | setTransient(boolean newTransientValue)
 | 
|  void | setTrueValue(java.lang.String trueValue)
 | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
CONVERTER_ID
public static final java.lang.String CONVERTER_ID
- See Also:
- Constant Field Values
BooleanConverter
public BooleanConverter()
getFalseValue
@JSFProperty
public java.lang.String getFalseValue()
- Value representing a boolean false, e.g. FALSE, no, 0, etc.
 
- 
 
- 
 
setFalseValue
public void setFalseValue(java.lang.String falseValue)
- 
 
- 
 
getTrueValue
@JSFProperty
public java.lang.String getTrueValue()
- Value representing a boolean true, e.g. TRUE, yes, 1, etc.
 
- 
 
- 
 
setTrueValue
public void setTrueValue(java.lang.String trueValue)
- 
 
- 
 
getAsObject
public java.lang.Object getAsObject(javax.faces.context.FacesContext facesContext,
                                    javax.faces.component.UIComponent uiComponent,
                                    java.lang.String value)
                             throws javax.faces.convert.ConverterException
- 
- Specified by:
- getAsObjectin interface- javax.faces.convert.Converter
 
- 
- Throws:
- javax.faces.convert.ConverterException
 
getAsString
public java.lang.String getAsString(javax.faces.context.FacesContext facesContext,
                                    javax.faces.component.UIComponent uiComponent,
                                    java.lang.Object value)
                             throws javax.faces.convert.ConverterException
- 
- Specified by:
- getAsStringin interface- javax.faces.convert.Converter
 
- 
- Throws:
- javax.faces.convert.ConverterException
 
isTransient
public boolean isTransient()
- 
- Specified by:
- isTransientin interface- javax.faces.component.StateHolder
 
- 
 
setTransient
public void setTransient(boolean newTransientValue)
- 
- Specified by:
- setTransientin interface- javax.faces.component.StateHolder
 
- 
 
restoreState
public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
- 
- Specified by:
- restoreStatein interface- javax.faces.component.StateHolder
 
- 
 
saveState
public java.lang.Object saveState(javax.faces.context.FacesContext context)
- 
- Specified by:
- saveStatein interface- javax.faces.component.StateHolder
 
- 
 
Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.