Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui
Interface UINode

All Known Subinterfaces:
MessageBean, MutableUINode
All Known Implementing Classes:
BaseUINode, DeprecatedUINode, UINodeProxy

public interface UINode

Interface for storing a node of a UIX Components (Marlin) UI tree.

Children of this UINode are stored in two separate fashions--by name or by index. How a child node is stored is dependent upon the contract between a UINode and its Renderer. For example, a Renderer that renders an arbitrary separator between each of its children may use a named child to indicate the UINode to use to render the separator, while the indexed children are used to indicate the children to render.

Note that other UINodes referenced by a UINode should be stored as either named children or indexed children. They should not be stored as attributes or private state.

UINodes do not store references to their parent UINodes. This allows the same instance of a UINode subtree to appear in multiple locations in the UINode tree.


Method Summary
 java.util.Enumeration getAttributeNames(RenderingContext context)
          Returns an Enumeration of the names that attribute values have been added under.
 java.lang.Object getAttributeValue(RenderingContext context, AttributeKey attrKey)
          Returns the value of the attribute with the specified name in the RenderingContext.
 java.lang.Object getAttributeValue(RenderingContext context, java.lang.String attrKey)
          Deprecated. The version of this function taking an AttributeKey rather than a String is more efficient, and thus preferred. Callers should be defining their AttributeKeys as constants and reusing them, rather than calling this method, and forcing the correct AttributeKey to be looked up each time.

 java.util.Enumeration getChildNames()
          Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the presence of any of the named children are determined by the RenderingContext.
 java.util.Enumeration getChildNames(RenderingContext context)
          Returns an Enumeration of the names that named children have been added under.
 java.lang.String getID()
          Returns the page-wide unique client ID of this node.
 UINode getIndexedChild(int childIndex)
          Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the specified indexed child is determined by the RenderingContext.
 UINode getIndexedChild(RenderingContext context, int childIndex)
          Returns the indexed child at the specified index.
 int getIndexedChildCount()
          Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the specified named child is determined by the RenderingContext.
 int getIndexedChildCount(RenderingContext 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(RenderingContext context, java.lang.String childName)
          Returns the child identified by childName.
 UINode getNamedChild(java.lang.String childName)
          Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the presence of any of the named children are determined by the RenderingContext.

 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.
 java.lang.String getNodeID()
          Returns an ID indentifying this UINode instance.
 NodeRole getNodeRole(RenderingContext context)
          Returns the role that this node occupies.
 java.lang.Object getRawAttributeValue(RenderingContext 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.
 void render(RenderingContext context)
          Renders this UINode.
 void render(RenderingContext context, UINode node)
           
 

Method Detail

getNodeID

public java.lang.String getNodeID()
Returns an ID indentifying this UINode instance. This ID is never output to the user agent.

This ID should not be confused with the ID_ATTR attribute, which is output to the client and is typically used in conjunction with client-side scripting technologies, such as JavaScript.


getNamespaceURI

public 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. 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

See Also:
getLocalName(), RendererManager, RendererFactory

getLocalName

public java.lang.String getLocalName()
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.


getIndexedChildCount

public int getIndexedChildCount(RenderingContext context)
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.

See Also:
getIndexedChild(oracle.cabo.ui.RenderingContext, int)

getIndexedChild

public UINode getIndexedChild(RenderingContext context,
                              int childIndex)
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.

See Also:
getIndexedChildCount(oracle.cabo.ui.RenderingContext)

getNamedChild

public UINode getNamedChild(RenderingContext context,
                            java.lang.String childName)
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 (Marlin)'s 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.

See Also:
getChildNames(oracle.cabo.ui.RenderingContext), UIConstants

getChildNames

public java.util.Enumeration getChildNames(RenderingContext context)
Returns an Enumeration 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 Enumeration 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.

See Also:
getNamedChild(oracle.cabo.ui.RenderingContext, java.lang.String)

getAttributeNames

public java.util.Enumeration getAttributeNames(RenderingContext context)
Returns an Enumeration 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 Enumeration 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.

See Also:
getAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey)

getAttributeValue

public java.lang.Object getAttributeValue(RenderingContext context,
                                          AttributeKey attrKey)
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.

See Also:
getAttributeNames(oracle.cabo.ui.RenderingContext)

getRawAttributeValue

public java.lang.Object getRawAttributeValue(RenderingContext 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.

See Also:
BoundValue

getNodeRole

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

render

public void render(RenderingContext context)
            throws java.io.IOException
Renders this UINode. Clients can implements this method in any way desired. All UIX Components (Marlin)-based implementations will get a RendererManager from the RenderingContext, get a Renderer, and defer rendering to that Renderer.

render

public void render(RenderingContext context,
                   UINode node)
            throws java.io.IOException

getID

public java.lang.String getID()
Returns the page-wide unique client ID of this node. The string returned must comply with the XML id specification--namely it must begin with a [a-z][A-z] and after that can contain as many of [a-z][A-Z][0-9][._-:] as desired.

This property is typically only needed when writing client-side JavaScript.

This method is only present on this interface for backwards compatibility and will be removed from this interface in a future version of UIX Components (Marlin) and moved to oracle.cabo.ui.beans.BaseWebBean


getIndexedChildCount

public int getIndexedChildCount()
Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the specified named child is determined by the RenderingContext.

Convenience function for returning the number of indexed children in this UINode.


getIndexedChild

public UINode getIndexedChild(int childIndex)
Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the specified indexed child is determined by the RenderingContext.

Convenience function for returning a n indexed UINode child given its index.


getChildNames

public java.util.Enumeration getChildNames()
Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the presence of any of the named children are determined by the RenderingContext.

Convenience function for returning an Enumeration of the names of the named children.


getNamedChild

public UINode getNamedChild(java.lang.String childName)
Deprecated. The version of this function also taking a RenderingContext is preferred, as this version will return incorrect results if the presence of any of the named children are determined by the RenderingContext.

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 (Marlin)'s 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.

See Also:
getChildNames(oracle.cabo.ui.RenderingContext), UIConstants

getAttributeValue

public java.lang.Object getAttributeValue(RenderingContext context,
                                          java.lang.String attrKey)
Deprecated. The version of this function taking an AttributeKey rather than a String is more efficient, and thus preferred. Callers should be defining their AttributeKeys as constants and reusing them, rather than calling this method, and forcing the correct AttributeKey to be looked up each time.

Returns the value of the attribute with the specified name in the UINode. 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.

See Also:
getAttributeNames(oracle.cabo.ui.RenderingContext)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.