org.apache.cocoon.woody.datatype
Class EnumSelectionList

java.lang.Object
  extended by org.apache.cocoon.woody.datatype.EnumSelectionList
All Implemented Interfaces:
SelectionList

public class EnumSelectionList
extends Object
implements SelectionList

This type of selection list outputs a list of items corresponding to the possible instances of an EnumType.

Example usage:

 <wd:selection-list type="enum" class="com.example.Sex"/>
 

Produces the following output:

 <wi:selection-list>
   <wi:item value=""/>
   <wi:item value="com.example.Sex.MALE">
     <wi:label>
       <i18n:text>com.example.Sex.MALE
     </wi:label>
   </wi:item>
   <wi:item value="com.example.Sex.FEMALE">
     <wi:label>
       <i18n:text>com.example.Sex.FEMALE
     </wi:label>
   </wi:item>
 </wi:selection-list>
 

If you don't want an initial null value, add a nullable="false" attribute to the wd:selection-list element.

Version:
CVS $Id: EnumSelectionList.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
static String I18N_NS
           
static String I18N_PREFIX_COLON
           
static String TEXT_EL
           
 
Fields inherited from interface org.apache.cocoon.woody.datatype.SelectionList
ITEM_EL, LABEL_EL, SELECTION_LIST_EL
 
Constructor Summary
EnumSelectionList(String className, Datatype datatype, boolean nullable)
           
 
Method Summary
 void generateSaxFragment(ContentHandler contentHandler, Locale locale)
           
 Datatype getDatatype()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

I18N_NS

public static final String I18N_NS
See Also:
Constant Field Values

I18N_PREFIX_COLON

public static final String I18N_PREFIX_COLON
See Also:
Constant Field Values

TEXT_EL

public static final String TEXT_EL
See Also:
Constant Field Values
Constructor Detail

EnumSelectionList

public EnumSelectionList(String className,
                         Datatype datatype,
                         boolean nullable)
                  throws ClassNotFoundException
Parameters:
className -
datatype -
Throws:
ClassNotFoundException
Method Detail

getDatatype

public Datatype getDatatype()
Specified by:
getDatatype in interface SelectionList

generateSaxFragment

public void generateSaxFragment(ContentHandler contentHandler,
                                Locale locale)
                         throws SAXException
Specified by:
generateSaxFragment in interface SelectionList
Throws:
SAXException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.