org.apache.myfaces.trinidadinternal.uinode
Class UIComponentUINode

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.uinode.UIComponentUINode
All Implemented Interfaces:
UINode
Direct Known Subclasses:
UIXComponentUINode

public class UIComponentUINode
extends java.lang.Object
implements UINode

Implements UINode and setAttributeValue().

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/uinode/UIComponentUINode.java#1 $) $Date: 11-nov-2005.14:59:38 $
Author:
The Oracle ADF Faces Team

Constructor Summary
protected UIComponentUINode(javax.faces.component.UIComponent component, java.lang.String namespace)
           
 
Method Summary
 java.util.Iterator<AttributeKey> getAttributeNames(UIXRenderingContext context)
          Returns an Iterator of the names that attribute values have been added under.
 java.lang.Object getAttributeValue(UIXRenderingContext context, AttributeKey attrKey)
          Returns the value of the attribute with the specified name in the RenderingContext.
 java.lang.Object getAttributeValue(UIXRenderingContext context, java.lang.String name)
           
 java.util.Iterator<java.lang.String> getChildNames()
           
 java.util.Iterator<java.lang.String> getChildNames(UIXRenderingContext context)
          Returns an Iterator of the names that named children have been added under.
 java.lang.String getID()
           
 UINode getIndexedChild(int i)
           
 UINode getIndexedChild(UIXRenderingContext context, int childIndex)
          Returns the indexed child at the specified index.
 int getIndexedChildCount()
           
 int getIndexedChildCount(UIXRenderingContext context)
          Returns the number of indexed children in this UINode.
 java.lang.String getLocalName()
          Name used to distinguish the name of a UINode within a namespace.
 UINode getNamedChild(java.lang.String name)
           
 UINode getNamedChild(UIXRenderingContext context, java.lang.String childName)
          Returns the child identified by childName.
 java.lang.String getNamespaceURI()
          The name space URI that segregates the local name of this UINode so that nodes with the same local name will not clash.
 NodeRole getNodeRole(UIXRenderingContext context)
          Returns the role that this node occupies.
 java.lang.Object getRawAttributeValue(UIXRenderingContext context, AttributeKey attrKey)
          Returns the value of the attribute with a specified name, without attempting to further resolve that value - as if , for instance, it might be a BoundValue.
 javax.faces.component.UIComponent getUIComponent()
          Returns the UIComponent that this node represents, or null if it is not attached to a UIComponent.
 void render(UIXRenderingContext context)
          jmw for testing translation key map public void render(RenderingContext context) throws IOException { // get stack from request map Stack componentStack = (Stack)context.getFacesContext().getExternalContext().
 void render(UIXRenderingContext context, UINode dataNode)
           
 void setAttributeValue(AttributeKey attrKey, java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UIComponentUINode

protected UIComponentUINode(javax.faces.component.UIComponent component,
                            java.lang.String namespace)
Method Detail

getUIComponent

public javax.faces.component.UIComponent getUIComponent()
Description copied from interface: UINode
Returns the UIComponent that this node represents, or null if it is not attached to a UIComponent.

Specified by:
getUIComponent in interface UINode

getID

public java.lang.String getID()

getNamespaceURI

public java.lang.String getNamespaceURI()
Description copied from interface: UINode
The name space URI that segregates the local name of this UINode so that nodes with the same local name will not clash. Together, the namespace URI and the local identify the kind of UINode that this is.

Any namespace String returned by this method should be interned for maximum performance. This allows namespace comparisons to be performed using object identity, versus the slower object equality. If the String returned is a String constant, the Java VM will have done this for you automatically.

As with all namespace URI's, this name is only used as an identifier. No other sematics are implied.

The RendererManager allows RendererFactorys to be registered by namespace.

TO DO: put in link to XML namespaces

Specified by:
getNamespaceURI in interface UINode
See Also:
UINode.getLocalName(), RendererManager, RendererFactory

getLocalName

public java.lang.String getLocalName()
Description copied from interface: UINode
Name used to distinguish the name of a UINode within a namespace.

Together with the UINode's namespace URI, the local name is typically used to determine which Renderer to use to render the UINode.

Specified by:
getLocalName in interface UINode

getIndexedChildCount

public int getIndexedChildCount(UIXRenderingContext context)
Description copied from interface: UINode
Returns the number of indexed children in this UINode.

If the UINode is mutable and may be modified and read in different threads, it is the programmer's responsibility to ensure proper synchronization.

Specified by:
getIndexedChildCount in interface UINode
See Also:
UINode.getIndexedChild(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, int)

getIndexedChild

public UINode getIndexedChild(UIXRenderingContext context,
                              int childIndex)
Description copied from interface: UINode
Returns the indexed child at the specified index. Indexed children are used to represent homogenously treated children of UINodes.

If the UINode is mutable and may be modified and read in different threads, it is the programmer's responsibility to ensure proper synchronization.

Specified by:
getIndexedChild in interface UINode
See Also:
UINode.getIndexedChildCount(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext)

getNamedChild

public UINode getNamedChild(UIXRenderingContext context,
                            java.lang.String childName)
Description copied from interface: UINode
Returns the child identified by childName. Named children are used to represent heterogenously treated children of UINodes.

Constants for named children used by UIX Components UINodes may be found in the UIConstants interface. The constants for the named children follow the pattern <xxx>_CHILD.

If the UINode is mutable and may be modified and read in different threads, it is the programmer's responsibility to ensure proper synchronization.

Specified by:
getNamedChild in interface UINode
See Also:
UINode.getChildNames(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext), UIConstants

getChildNames

public java.util.Iterator<java.lang.String> getChildNames(UIXRenderingContext context)
Description copied from interface: UINode
Returns an Iterator of the names that named children have been added under. The actual UINodes for these named children may be retrieved by passing the Strings returned by this Iterator to getNamedChild.

If the UINode is mutable and may be modified and read in different threads, it is the programmer's responsibility to ensure proper synchronization.

Specified by:
getChildNames in interface UINode
See Also:
UINode.getNamedChild(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.String)

getAttributeNames

public java.util.Iterator<AttributeKey> getAttributeNames(UIXRenderingContext context)
Description copied from interface: UINode
Returns an Iterator of the names that attribute values have been added under. The actual values for these attributes may be retrieved by passing the AttributeKeys returned by this Iterator to getAttributeValue.

If the UINode is mutable and may be modified and read in different threads, it is the programmer's responsibility to ensure proper synchronization.

Specified by:
getAttributeNames in interface UINode
See Also:
UINode.getAttributeValue(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, org.apache.myfaces.trinidadinternal.ui.AttributeKey)

setAttributeValue

public void setAttributeValue(AttributeKey attrKey,
                              java.lang.Object value)

getAttributeValue

public java.lang.Object getAttributeValue(UIXRenderingContext context,
                                          AttributeKey attrKey)
Description copied from interface: UINode
Returns the value of the attribute with the specified name in the RenderingContext. If no attribute with the specified name exists in this UINode, or a checked Exception occurs in retrieving the value of the attribute, null will be returned.

Note that as with indexed children and named children, the presence of of an attribute is no guarantee that the Renderer used to render this UINode will actually use the attribute. The presence of attributes should only be considered as hints to the Renderer.

If the UINode is mutable and may be modified and read in different threads, it is the programmer's responsibility to ensure proper synchronization.

Specified by:
getAttributeValue in interface UINode
See Also:
UINode.getAttributeNames(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext)

getRawAttributeValue

public java.lang.Object getRawAttributeValue(UIXRenderingContext context,
                                             AttributeKey attrKey)
Returns the value of the attribute with a specified name, without attempting to further resolve that value - as if , for instance, it might be a BoundValue.

Specified by:
getRawAttributeValue in interface UINode
See Also:
BoundValue

getNodeRole

public NodeRole getNodeRole(UIXRenderingContext context)
Returns the role that this node occupies.

Specified by:
getNodeRole in interface UINode

render

public void render(UIXRenderingContext context)
            throws java.io.IOException
jmw for testing translation key map public void render(RenderingContext context) throws IOException { // get stack from request map Stack componentStack = (Stack)context.getFacesContext().getExternalContext(). getRequestMap().get("TRANSLATION_KEY"); // if it is null, create it if (componentStack == null) componentStack = new Stack(); // _setTranslationKeyTest pushes the key onto the stack _setTranslationKeyTest(context, getUIComponent(), componentStack); //jmw test render(context, this); // pop one entry from the stack // jmw for testing if (componentStack != null) componentStack.pop(); }

Specified by:
render in interface UINode
Throws:
java.io.IOException

render

public void render(UIXRenderingContext context,
                   UINode dataNode)
            throws java.io.IOException
Specified by:
render in interface UINode
Throws:
java.io.IOException

toString

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

getIndexedChildCount

public int getIndexedChildCount()

getIndexedChild

public UINode getIndexedChild(int i)

getChildNames

public java.util.Iterator<java.lang.String> getChildNames()

getNamedChild

public UINode getNamedChild(java.lang.String name)

getAttributeValue

public java.lang.Object getAttributeValue(UIXRenderingContext context,
                                          java.lang.String name)


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.