javax.faces.component
Interface NamingContainer

All Known Implementing Classes:
NamingContainerSupport, UINamingContainer, javax.faces.component.UISelectBase

public interface NamingContainer

NamingContainer is an interface that must be implemented by any UIComponent that wants to be a naming container.


Method Summary
 void addComponentToNamespace(UIComponent component)
          Add the specified UIComponent to the namespace of this naming container.
 UIComponent findComponentInNamespace(java.lang.String name)
          Find and return a UIComponent in this namespace, if it is present; otherwise return null.
 java.lang.String generateClientId()
          Generate an identifier for a component, suitable for communication to a client.
 void removeComponentFromNamespace(UIComponent component)
          Remove the specified UIComponent from the namespace of this naming container, if it is present.
 

Method Detail

addComponentToNamespace

public void addComponentToNamespace(UIComponent component)

Add the specified UIComponent to the namespace of this naming container.

Parameters:
component - The UIComponent to be added
Throws:
java.lang.IllegalArgumentException - if the specified component does not have a componentId
java.lang.IllegalStateException - if the component identifier of the specified component is not unique within the namespace of this naming container
java.lang.NullPointerException - if component is null

removeComponentFromNamespace

public void removeComponentFromNamespace(UIComponent component)

Remove the specified UIComponent from the namespace of this naming container, if it is present.

Parameters:
component - The UIComponent to be removed
Throws:
java.lang.IllegalArgumentException - if the specified component does not have a componentId
java.lang.NullPointerException - if component is null

findComponentInNamespace

public UIComponent findComponentInNamespace(java.lang.String name)

Find and return a UIComponent in this namespace, if it is present; otherwise return null.

If the argument name does not contain any UIComponent.SEPARATOR_CHAR characters, it is interpreted to be a name in the namespace of this naming container.

If the argument name does contain UIComponent.SEPARATOR_CHAR characters, each segment between UIComponent.SEPARATOR_CHAR is treated as a component identifier in its own namespace, which are searched for in child naming containers of this naming container, from left to right.

Parameters:
name - Identifier of the desired component
Throws:
java.lang.IllegalArgumentException - if name is malformed
java.lang.NullPointerException - if name is null

generateClientId

public java.lang.String generateClientId()

Generate an identifier for a component, suitable for communication to a client. The identifier returned from this method must be unique within this namespace.