org.apache.myfaces.trinidaddemo
Class TreeModelAdapter

java.lang.Object
  extended by org.apache.myfaces.trinidaddemo.TreeModelAdapter
All Implemented Interfaces:
Serializable

public class TreeModelAdapter
extends Object
implements Serializable

This class facilitates the construction of a ChildPropertyTreeModel instance via managed-beans. ChildPropertyTreeModel does not have a no-arg constructor. This class does, and so can be instantiated as a managed-bean. Two properties need to be set: "childProperty" and "instance"

See Also:
Serialized Form

Constructor Summary
TreeModelAdapter()
           
 
Method Summary
 String getChildProperty()
           
 Object getInstance()
           
 List<Object> getListInstance()
          This should only be called if setListInstance was called.
 TreeModel getModel()
           
 void setChildProperty(String propertyName)
          Sets the property to use to get at child lists
 void setInstance(Object instance)
          Sets the root list for this tree.
 void setListInstance(List<Object> instance)
          Sets the root list for this tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeModelAdapter

public TreeModelAdapter()
Method Detail

getModel

public TreeModel getModel()
                   throws IntrospectionException
Throws:
IntrospectionException

getChildProperty

public String getChildProperty()

setChildProperty

public void setChildProperty(String propertyName)
Sets the property to use to get at child lists

Parameters:
propertyName -

getInstance

public Object getInstance()

setInstance

public void setInstance(Object instance)
Sets the root list for this tree.

Parameters:
instance - must be something that can be converted into a List

setListInstance

public void setListInstance(List<Object> instance)
Sets the root list for this tree. This is needed for passing a List when using the managed bean list creation facility, which requires the parameter type is List.

Parameters:
instance - the list of root nodes

getListInstance

public List<Object> getListInstance()
This should only be called if setListInstance was called. This method shouldn't be needed according to faces spec 1.1 rev 1, see 5.3.1.3 However without this we get the following error in websphere: java.beans.IntrospectionException: No method "getListInstance" with 0 arg(s) of matching types in websphere



Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.