org.objectweb.telosys.screen.core
Class ScreenDataElements

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.screen.core.ScreenDataElements

public class ScreenDataElements
extends TelosysObject

A temporary collection of ScreenDataElement instances

Used to store :
. the data elements of a ScreenRequest ( XML "data" section received from the client side ),
. the data elements of a ScreenResponse ( XML "data" section send to the client side )
. a copy of the ScreenContext elements


Constructor Summary
ScreenDataElements()
          Default constructor
ScreenDataElements(java.util.Collection elements)
          Constructor from elements collection
 
Method Summary
 void add(ScreenDataElement oElement)
          Adds an element in the elements collection
 void add(java.lang.String sElementName, java.lang.Object oBean)
          Adds an element in the elements collection
 ScreenDataElement get(int index)
          Returns the element located at the given index
 ScreenDataElement get(java.lang.String sElementName)
          Returns the element having the given name (or null if not found)
If there's multiple elements with the same name, the first element found is returned.
 java.lang.Object getDataElementInstance(java.lang.String sElementName, java.lang.Class clazz)
          Returns the element object having the given name and instance of the given class (or null if not found)
If there's multiple elements with the same name, the first element found is returned.
 java.util.Iterator iterator()
          Returns an iterator for the elements collection
 int size()
          Returns the size of the elements collection
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScreenDataElements

public ScreenDataElements()
Default constructor


ScreenDataElements

public ScreenDataElements(java.util.Collection elements)
Constructor from elements collection

Parameters:
elements -
Method Detail

add

public void add(ScreenDataElement oElement)
Adds an element in the elements collection

Parameters:
oElement -

add

public void add(java.lang.String sElementName,
                java.lang.Object oBean)
Adds an element in the elements collection

Parameters:
sElementName -
oBean -

size

public int size()
Returns the size of the elements collection

Returns:

get

public ScreenDataElement get(int index)
Returns the element located at the given index

Parameters:
index -
Returns:

get

public ScreenDataElement get(java.lang.String sElementName)
Returns the element having the given name (or null if not found)
If there's multiple elements with the same name, the first element found is returned.

Parameters:
sElementName -
Returns:

getDataElementInstance

public java.lang.Object getDataElementInstance(java.lang.String sElementName,
                                               java.lang.Class clazz)
Returns the element object having the given name and instance of the given class (or null if not found)
If there's multiple elements with the same name, the first element found is returned.

Parameters:
sElementName -
clazz - if null the type of the object is not checked
Returns:

iterator

public java.util.Iterator iterator()
Returns an iterator for the elements collection

Returns:

toString

public java.lang.String toString()