org.apache.cocoon.forms.datatype
Class AbstractJavaSelectionList

java.lang.Object
  extended by org.apache.cocoon.forms.datatype.AbstractJavaSelectionList
All Implemented Interfaces:
Serviceable, JavaSelectionList, SelectionList
Direct Known Subclasses:
DateTestJavaSelectionList

public abstract class AbstractJavaSelectionList
extends Object
implements JavaSelectionList, Serviceable

Abstract implementation of a JavaSelectionList


Field Summary
protected  Datatype datatype
           
protected  ServiceManager manager
           
 
Fields inherited from interface org.apache.cocoon.forms.datatype.SelectionList
ITEM_EL, LABEL_EL, SELECTION_LIST_EL
 
Constructor Summary
AbstractJavaSelectionList()
           
 
Method Summary
protected  void addItem(Object value, String label)
          Adds a new item to this selection list.
protected  void addItem(Object value, XMLizable label)
          Adds a new item to this selection list.
protected abstract  boolean build()
          Build the list of SelectionListItems using #addItem(Object, String).
 void generateSaxFragment(ContentHandler contentHandler, Locale locale)
           
 String getAttribute(String name)
           
 Datatype getDatatype()
           
protected  List getItems()
           
 boolean isNullable()
           
 void markForRebuild()
          Enforce one rebuild on next usage of #generateSaxFragment(ContentHandler, Locale).
 void removeAttribute(String name)
           
 void service(ServiceManager manager)
           
 void setAttribute(String name, String value)
           
 void setDatatype(Datatype datatype)
           
 void setNullable(boolean nullable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datatype

protected Datatype datatype

manager

protected ServiceManager manager
Constructor Detail

AbstractJavaSelectionList

public AbstractJavaSelectionList()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

getAttribute

public String getAttribute(String name)
Specified by:
getAttribute in interface JavaSelectionList

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface JavaSelectionList

setAttribute

public void setAttribute(String name,
                         String value)
Specified by:
setAttribute in interface JavaSelectionList

isNullable

public boolean isNullable()
Specified by:
isNullable in interface JavaSelectionList

setDatatype

public void setDatatype(Datatype datatype)
Specified by:
setDatatype in interface JavaSelectionList

setNullable

public void setNullable(boolean nullable)
Specified by:
setNullable in interface JavaSelectionList

getDatatype

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

markForRebuild

public void markForRebuild()
Enforce one rebuild on next usage of #generateSaxFragment(ContentHandler, Locale).


generateSaxFragment

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

build

protected abstract boolean build()
                          throws Exception
Build the list of SelectionListItems using #addItem(Object, String).

Returns:
true if the list should be rebuild on each usage, false if it is static.
Throws:
Exception

addItem

protected void addItem(Object value,
                       String label)
Adds a new item to this selection list.

Parameters:
value - a value of the correct type (i.e. the type with which this selectionlist is associated)
label - string label, can be null.

addItem

protected void addItem(Object value,
                       XMLizable label)
Adds a new item to this selection list.

Parameters:
value - a value of the correct type (i.e. the type with which this selectionlist is associated)
label - a SAX-fragment such as a SaxBuffer, can be null

getItems

protected List getItems()


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