Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui.path
Class MutableUINodeAdapter

java.lang.Object
  |
  +--oracle.cabo.ui.DeprecatedUINode
        |
        +--oracle.cabo.ui.UINodeProxy
              |
              +--oracle.cabo.ui.path.MutableUINodeAdapter
All Implemented Interfaces:
MutableUINode, UINode

public class MutableUINodeAdapter
extends UINodeProxy
implements MutableUINode

MutableUINodeAdapter extends UINodeProxy to add mutability. It is not a proxy to a MutableUINode, rather it is a mutable proxy to any UINode.


Constructor Summary
MutableUINodeAdapter(UINode node)
          Creates a MutableUINodeAdapter wrapping the given UINode.
 
Method Summary
 void addIndexedChild(int childIndex, UINode child)
          Inserts an indexed child to the node.
 void addIndexedChild(UINode child)
          Inserts an indexed child to the node, placing after all other nodes.
 void clearIndexedChildren()
          Removes all of the indexed children.
 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(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(RenderingContext context)
          Returns an Enumeration of the names that named children have been added under.
 UINode getIndexedChild(RenderingContext context, int childIndex)
          Returns the indexed child at the specified index.
 int getIndexedChildCount(RenderingContext context)
          Returns the number of indexed children in this UINode.
 UINode getNamedChild(RenderingContext context, java.lang.String childName)
          Returns the child identified by childName.
 java.lang.String getNodeID()
          Returns an ID indentifying this UINode instance.
 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.
protected  UINode getUINode()
          Returns the UINode proxied by this instance.
 UINode removeIndexedChild(int childIndex)
          Removes an indexed child from the node.
 void replaceIndexedChild(int childIndex, UINode child)
          Replaces a single child.
 void setAttributeValue(AttributeKey attrKey, java.lang.Object value)
          Sets an attribute value of the node.
 void setAttributeValue(java.lang.String attrKey, BoundValue value)
          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.
 void setAttributeValue(java.lang.String attrKey, java.lang.Object value)
          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.
 void setID(java.lang.String newID)
          Sets the page-wide unique client ID of this node.
 void setNamedChild(java.lang.String childName, UINode namedChild)
          Sets a named child on the node.
 void setNodeID(java.lang.String nodeID)
          Sets the ID indentifying this UINode instance.
 
Methods inherited from class oracle.cabo.ui.UINodeProxy
getLocalName, getNamespaceURI, getNodeRole, getRenderingContext, render, render, toString
 
Methods inherited from class oracle.cabo.ui.DeprecatedUINode
getAttributeValue, getChildNames, getID, getIndexedChild, getIndexedChildCount, getNamedChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.cabo.ui.UINode
getAttributeValue, getChildNames, getID, getIndexedChild, getIndexedChildCount, getLocalName, getNamedChild, getNamespaceURI, getNodeRole, render, render
 

Constructor Detail

MutableUINodeAdapter

public MutableUINodeAdapter(UINode node)
Creates a MutableUINodeAdapter wrapping the given UINode.
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.

Specified by:
getNodeID in interface UINode
Overrides:
getNodeID in class UINodeProxy

getIndexedChildCount

public int getIndexedChildCount(RenderingContext context)
Returns the number of indexed children in this UINode.

Specified by:
getIndexedChildCount in interface UINode
Overrides:
getIndexedChildCount in class UINodeProxy
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.

Specified by:
getIndexedChild in interface UINode
Overrides:
getIndexedChild in class UINodeProxy
See Also:
getIndexedChildCount(oracle.cabo.ui.RenderingContext)

addIndexedChild

public void addIndexedChild(int childIndex,
                            UINode child)
Inserts an indexed child to the node. Shifts the element currently at that position, if any, and any subsequent elements to the right (adds one to their indices). Children may be added to the end of the list of indexed children by:

node.addIndexedChild(node.getIndexedChildCount(), lastChild);

Unlike many other APIs, adding a child does not remove it from any other parent nodes. In fact, the same child UINode instance is allowed to appear in multiple different indices of the same parent UINode.

Specified by:
addIndexedChild in interface MutableUINode
Parameters:
childIndex - the zero-based index to add the child at.
child - the new child node

See Also:
removeIndexedChild(int), clearIndexedChildren(), List.add(java.lang.Object)

addIndexedChild

public final void addIndexedChild(UINode child)
Description copied from interface: MutableUINode
Inserts an indexed child to the node, placing after all other nodes.

Unlike many other APIs, adding a child does not remove it from any other parent nodes. In fact, the same child UINode instance is allowed to appear in multiple different indices of the same parent UINode.

Specified by:
addIndexedChild in interface MutableUINode
Following copied from interface: oracle.cabo.ui.MutableUINode
Parameters:
child - the new child node

See Also:
MutableUINode.removeIndexedChild(int), MutableUINode.clearIndexedChildren(), List.add(java.lang.Object)

removeIndexedChild

public UINode removeIndexedChild(int childIndex)
Removes an indexed child from the node.
Specified by:
removeIndexedChild in interface MutableUINode
Parameters:
childIndex - the zero-based index of the child to remove

See Also:
clearIndexedChildren(), List.remove(java.lang.Object)

replaceIndexedChild

public void replaceIndexedChild(int childIndex,
                                UINode child)
Replaces a single child.

Although this method could be implemented in terms of addIndexedChild and removeIndexedChild, it is present on this interface in order to allow for more efficient implementations.

Specified by:
replaceIndexedChild in interface MutableUINode
Parameters:
childIndex - the zero-based index to add the child at.
child - the new child node

See Also:
removeIndexedChild(int)

clearIndexedChildren

public void clearIndexedChildren()
Removes all of the indexed children.

Although this method could be implemented in terms of removeIndexedChild, it is present on this interface in order to allow for more efficient implementations.

Specified by:
clearIndexedChildren in interface MutableUINode
See Also:
removeIndexedChild(int), Collection.clear()

setNamedChild

public void setNamedChild(java.lang.String childName,
                          UINode namedChild)
Sets a named child on the node. Any node attached with that name will be removed.

Specified by:
setNamedChild in interface MutableUINode
Parameters:
childName - the name of the child
namedChild - the child; passing null will remove any existing UINode with that name.

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 Component 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
Overrides:
getNamedChild in class UINodeProxy
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.

Specified by:
getChildNames in interface UINode
Overrides:
getChildNames in class UINodeProxy
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 Strings 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.

Specified by:
getAttributeNames in interface UINode
Overrides:
getAttributeNames in class UINodeProxy
See Also:
getAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey)

setAttributeValue

public void setAttributeValue(AttributeKey attrKey,
                              java.lang.Object value)
Sets an attribute value of the node.
Specified by:
setAttributeValue in interface MutableUINode
Parameters:
attrKey - the key of the attribute
value - the new value; passing null will remove any existing attribute with that name.

getAttributeValue

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

Specified by:
getAttributeValue in interface UINode
Overrides:
getAttributeValue in class UINodeProxy
See Also:
getAttributeNames(oracle.cabo.ui.RenderingContext)

getRawAttributeValue

public final java.lang.Object getRawAttributeValue(RenderingContext context,
                                                   AttributeKey attrKey)
Description copied from interface: UINode
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
Overrides:
getRawAttributeValue in class UINodeProxy
Following copied from interface: oracle.cabo.ui.UINode
See Also:
BoundValue

setNodeID

public void setNodeID(java.lang.String nodeID)
Sets the ID indentifying this UINode instance. This ID is never output to the user agent.

Node IDs should be static over the lifetime of a webbean, so clients should avoid setting the node ID more than once.

This method is especiall useful for clients creating webbeans with <jsp:usebean> as that creation approach can only use zero-argument constructors.

Specified by:
setNodeID in interface MutableUINode

getAttributeValue

public final java.lang.Object getAttributeValue(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. 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.

Specified by:
getAttributeValue in interface MutableUINode

setID

public void setID(java.lang.String newID)
Sets the page-wide unique client ID of this node. The string set 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 and moved to oracle.cabo.ui.beans.BaseWebBean

Specified by:
setID in interface MutableUINode

setAttributeValue

public final void setAttributeValue(java.lang.String attrKey,
                                    java.lang.Object value)
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.

Sets an attribute value of the node.
Specified by:
setAttributeValue in interface MutableUINode
Parameters:
attrKey - the name of the attribute
value - the new value; passing null will remove any existing attribute with that name.

setAttributeValue

public void setAttributeValue(java.lang.String attrKey,
                              BoundValue value)
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.

Sets an attribute value of the node.
Specified by:
setAttributeValue in interface MutableUINode
Parameters:
attrKey - the name of the attribute
value - the new value; passing null will remove any existing attribute with that name. 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.

getUINode

protected UINode getUINode()
Returns the UINode proxied by this instance.
Overrides:
getUINode in class UINodeProxy

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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