org.jboss.portal.test.framework.info
Class TestContainerInfo

java.lang.Object
  extended by org.jboss.portal.test.framework.info.TestItemInfo
      extended by org.jboss.portal.test.framework.info.TestContainerInfo
All Implemented Interfaces:
java.io.Serializable

public class TestContainerInfo
extends TestItemInfo

Container for items.

Version:
$Revision: 7228 $
Author:
Julien Viet
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.portal.test.framework.info.TestItemInfo
TestItemInfo.AbstractVisitor, TestItemInfo.Visitor
 
Field Summary
 
Fields inherited from class org.jboss.portal.test.framework.info.TestItemInfo
description, name, parent
 
Constructor Summary
TestContainerInfo(java.lang.String name)
          Create a named container.
TestContainerInfo(java.lang.String name, java.lang.String description)
          Create a named container.
TestContainerInfo(TestContainerInfo that)
          Copy constructor which performs a deep copy of the structure.
 
Method Summary
 void addChild(TestItemInfo child)
          Add a child to this container
 TestItemInfo createClone()
          Create a deep clone of the current item in a detyped manner.
 TestItemInfo findItem(java.lang.String itemId)
          Find an item within the scope of the current item.
 TestItemInfo getChild(java.lang.String childName)
          Retrieve a specified child
 java.util.Set getChildNames()
          Return the set of child names.
protected  void internalVisit(TestItemInfo.Visitor visitor)
           
 void removeChild(java.lang.String childName)
          Remove a child from this container.
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.portal.test.framework.info.TestItemInfo
getDescription, getId, getName, getParent, internalGetId, internalGetId, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestContainerInfo

public TestContainerInfo(java.lang.String name)
                  throws java.lang.IllegalArgumentException
Create a named container.

Parameters:
name - the container name
Throws:
java.lang.IllegalArgumentException - if the name is null

TestContainerInfo

public TestContainerInfo(java.lang.String name,
                         java.lang.String description)
                  throws java.lang.IllegalArgumentException
Create a named container.

Parameters:
name - the container name
description - the container description
Throws:
java.lang.IllegalArgumentException - if the name is null

TestContainerInfo

public TestContainerInfo(TestContainerInfo that)
                  throws java.lang.IllegalArgumentException
Copy constructor which performs a deep copy of the structure.

Parameters:
that - the structure to deep copy
Throws:
java.lang.IllegalArgumentException - if the container to copy is null
Method Detail

createClone

public TestItemInfo createClone()
Description copied from class: TestItemInfo
Create a deep clone of the current item in a detyped manner.

Specified by:
createClone in class TestItemInfo
Returns:
a deep clone of the current item

internalVisit

protected void internalVisit(TestItemInfo.Visitor visitor)
Specified by:
internalVisit in class TestItemInfo

addChild

public void addChild(TestItemInfo child)
              throws java.lang.IllegalArgumentException
Add a child to this container

Parameters:
child - the child to add
Throws:
java.lang.IllegalArgumentException - if the child is null or already in the container

removeChild

public void removeChild(java.lang.String childName)
                 throws java.lang.IllegalArgumentException
Remove a child from this container.

Parameters:
childName - the name of the child to remove
Throws:
java.lang.IllegalArgumentException - if the child name is null or the child does not exist

getChild

public TestItemInfo getChild(java.lang.String childName)
                      throws java.lang.IllegalArgumentException
Retrieve a specified child

Parameters:
childName - the child name to retrieve
Returns:
the child or null if it cant be found
Throws:
java.lang.IllegalArgumentException - if the child name is null

getChildNames

public java.util.Set getChildNames()
Return the set of child names.

Returns:
the child names

findItem

public TestItemInfo findItem(java.lang.String itemId)
Description copied from class: TestItemInfo
Find an item within the scope of the current item.

Specified by:
findItem in class TestItemInfo
Parameters:
itemId - the item id to find
Returns:
the item or null if not found

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object