oracle.cabo.ui.xml.parse
Class BaseUINodeType

java.lang.Object
  |
  +--oracle.cabo.ui.xml.parse.BaseUINodeType
All Implemented Interfaces:
UINodeType

public class BaseUINodeType
extends java.lang.Object
implements UINodeType

Base implementation of UINodeType.


Fields inherited from interface oracle.cabo.ui.xml.parse.UINodeType
CHILD_TYPE_ATTRIBUTE_MAP, CHILD_TYPE_BOUND_VALUE, CHILD_TYPE_DATA_PROVIDER, CHILD_TYPE_ENVELOPE_ATTRIBUTE, CHILD_TYPE_INDEXED_CHILD_IN_PLACE, CHILD_TYPE_INDEXED_CHILDREN, CHILD_TYPE_INLINE_ATTRIBUTE, CHILD_TYPE_NAMED_CHILD, CHILD_TYPE_NODE_LIST, CHILD_TYPE_NODE_MAP, CHILD_TYPE_UNKNOWN
 
Constructor Summary
BaseUINodeType(java.lang.String namespaceURI, java.lang.String[] namedChildren, java.lang.Object[] attributeTypes)
          Creates a root BaseUINodeType.
BaseUINodeType(java.lang.String namespaceURI, java.lang.String[] namedChildren, java.lang.Object[] attributeTypes, UINodeType superType)
          Creates a subclass BaseUINodeType.
BaseUINodeType(java.lang.String namespaceURI, java.lang.String[] namedChildren, java.lang.Object[] attributeTypes, UINodeType superType, boolean stripWhitespace)
          Creates a subclass BaseUINodeType.
 
Method Summary
 java.lang.Object convertAttributeValue(ParseContext context, AttributeKey key, java.lang.String stringValue)
          Given an attribute key and its string value, returns the Java object for that attribute.
 BoundValue convertBoundValue(ParseContext context, AttributeKey key, BoundValue value)
          Given an attribute key and a BoundValue implementation used to retrieve that attribute, returns a BoundValue that will return Java objects of the correct type.
static BaseUINodeType createDefaultUINodeType(java.lang.String namespace)
          Returns a UINodeType containing type information for attributes supported by all UINodes.
 BaseMutableUINode createUINode(java.lang.String namespaceURI, java.lang.String localName)
          Creates a BaseMutableUINode.
 java.lang.Class getAttributeClass(ParseContext context, AttributeKey key)
          Returns the Java class expected for a given AttributeKey.
 int getChildType(java.lang.String namespaceURI, java.lang.String localName)
          Returns the CHILD_TYPE constant for an XML element.
 NodeParser getCustomNodeParser(ParseContext context, java.lang.String namespaceURI, java.lang.String localName)
          Returns the custom NodeParser implementation that should be used for this node type.
static UINodeType getDefaultUINodeType()
          Returns a UINodeType containing type information for attributes supported by all UINodes.
 java.lang.String getNamespaceURI()
          Returns the namespace of the UINodeType.
protected  boolean isIndexedChildElement(java.lang.String name)
          Returns the string element name used for indexed children.
 void setUINodeClass(java.lang.Class nodeClass)
          Set the Class that will be used to instantiate nodes of this type.
 boolean stripWhitespace()
          Returns whether this type of node wants whitespace; if true, whitespace will be dropped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUINodeType

public BaseUINodeType(java.lang.String namespaceURI,
                      java.lang.String[] namedChildren,
                      java.lang.Object[] attributeTypes)
Creates a root BaseUINodeType.
Parameters:
namespaceURI - the namespace of the node
namedChildren - an array of strings that should be considered named children
attributeTypes - an array of attribute types, alternating between AttributeKey objects and Java class objects

BaseUINodeType

public BaseUINodeType(java.lang.String namespaceURI,
                      java.lang.String[] namedChildren,
                      java.lang.Object[] attributeTypes,
                      UINodeType superType)
Creates a subclass BaseUINodeType.
Parameters:
namespaceURI - the namespace of the node
namedChildren - an array of strings that should be considered named children
attributeTypes - an array of attribute types, alternating between AttributeKey objects and Java class objects
superType - the supertype of this type

BaseUINodeType

public BaseUINodeType(java.lang.String namespaceURI,
                      java.lang.String[] namedChildren,
                      java.lang.Object[] attributeTypes,
                      UINodeType superType,
                      boolean stripWhitespace)
Creates a subclass BaseUINodeType.
Parameters:
namespaceURI - the namespace of the node
namedChildren - an array of strings that should be considered named children
attributeTypes - an array of attribute types, alternating with string names and Java class objects
superType - the supertype of this type
stripWhitespace - the supertype of this type
Method Detail

getDefaultUINodeType

public static UINodeType getDefaultUINodeType()
Returns a UINodeType containing type information for attributes supported by all UINodes.

createDefaultUINodeType

public static BaseUINodeType createDefaultUINodeType(java.lang.String namespace)
Returns a UINodeType containing type information for attributes supported by all UINodes.

setUINodeClass

public void setUINodeClass(java.lang.Class nodeClass)
Set the Class that will be used to instantiate nodes of this type. The node must subclass BaseMutableUINode, and must have a zero-argument constructor.

createUINode

public BaseMutableUINode createUINode(java.lang.String namespaceURI,
                                      java.lang.String localName)
                               throws java.lang.InstantiationException,
                                      java.lang.IllegalAccessException
Creates a BaseMutableUINode.
Specified by:
createUINode in interface UINodeType

getNamespaceURI

public java.lang.String getNamespaceURI()
Returns the namespace of the UINodeType.

getCustomNodeParser

public NodeParser getCustomNodeParser(ParseContext context,
                                      java.lang.String namespaceURI,
                                      java.lang.String localName)
Returns the custom NodeParser implementation that should be used for this node type. If null, UINodeParser will be used.
Specified by:
getCustomNodeParser in interface UINodeType

getAttributeClass

public java.lang.Class getAttributeClass(ParseContext context,
                                         AttributeKey key)
Returns the Java class expected for a given AttributeKey.
Specified by:
getAttributeClass in interface UINodeType
Parameters:
context - a ParseContext
key - the attribute key

convertAttributeValue

public java.lang.Object convertAttributeValue(ParseContext context,
                                              AttributeKey key,
                                              java.lang.String stringValue)
Given an attribute key and its string value, returns the Java object for that attribute.
Specified by:
convertAttributeValue in interface UINodeType
Parameters:
context - a ParseContext
key - the attribute key
name - the string value of the attribute

convertBoundValue

public BoundValue convertBoundValue(ParseContext context,
                                    AttributeKey key,
                                    BoundValue value)
Given an attribute key and a BoundValue implementation used to retrieve that attribute, returns a BoundValue that will return Java objects of the correct type.
Specified by:
convertBoundValue in interface UINodeType
Parameters:
context - a ParseContext
key - the attribute key
name - the BoundValue to be used for the attribute

getChildType

public int getChildType(java.lang.String namespaceURI,
                        java.lang.String localName)
Returns the CHILD_TYPE constant for an XML element.
Specified by:
getChildType in interface UINodeType
Parameters:
namespaceURI - the namespace of the element
namespaceURI - the local name of the element

stripWhitespace

public boolean stripWhitespace()
Returns whether this type of node wants whitespace; if true, whitespace will be dropped.
Specified by:
stripWhitespace in interface UINodeType

isIndexedChildElement

protected boolean isIndexedChildElement(java.lang.String name)
Returns the string element name used for indexed children. Defaults to UIConstants.CONTENTS_NAME.