com.webmethods.caf.faces.data.tree.object
Class BaseXMLNode

java.lang.Object
  extended by com.webmethods.caf.faces.data.tree.object.BaseXMLNode
All Implemented Interfaces:
IContentProvider, INode
Direct Known Subclasses:
XMLDOMNode2, XMLElementNode2

public abstract class BaseXMLNode
extends Object
implements INode, IContentProvider

Base class for adapting a W3C DOM Node to a CAF tree INode and CAF data IContentProvider (as a IContentProvider, binding-expression access to the node's properties can be optimized).


Field Summary
protected  List m_children
          Lazily created by INode.getChildren().
protected  String m_id
          Lazily created by INode.getId().
protected  INode m_parent
          Null if root.
protected  CachedXPathAPI m_xpathAPI
          Lazily created by BaseXMLNode.getXPathAPI().
protected  Map m_xpathCache
          Lazily created cache of xpaths to evaluated results.
 
Constructor Summary
BaseXMLNode()
           
 
Method Summary
 Object getData()
          Row data.
 INode getParent()
          Node parent, or null for root.
 Object[] getPropertyKeys()
          Returns list of properties supported by this content provider.
 Class getType(Object propertyKey)
          Returns java type of the given property
 Object getValue(Object propertyKey)
          Returns value of the given property
protected abstract  Node getXMLNode()
          Wrapped DOM node.
protected  CachedXPathAPI getXPathAPI()
          Xalan xpath api context.
protected  Object getXPathValue(String xpath)
          Evaluates the specified xpath for the wrapped dom node.
 boolean hasProperty(Object propertyKey)
          Checks if the given property is supported by this content provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.webmethods.caf.faces.data.tree.INode
getChildren, getId
 
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
toString
 

Field Detail

m_xpathAPI

protected CachedXPathAPI m_xpathAPI
Lazily created by BaseXMLNode.getXPathAPI().


m_xpathCache

protected Map m_xpathCache
Lazily created cache of xpaths to evaluated results.


m_id

protected String m_id
Lazily created by INode.getId().


m_parent

protected INode m_parent
Null if root.


m_children

protected List m_children
Lazily created by INode.getChildren().

Constructor Detail

BaseXMLNode

public BaseXMLNode()
Method Detail

getData

public Object getData()
Description copied from interface: INode
Row data.

Specified by:
getData in interface INode

getParent

public INode getParent()
Description copied from interface: INode
Node parent, or null for root.

Specified by:
getParent in interface INode

getPropertyKeys

public Object[] getPropertyKeys()
Description copied from interface: IContentProvider
Returns list of properties supported by this content provider. Can return Object[0], never null.

Specified by:
getPropertyKeys in interface IContentProvider
Returns:
array of property keys which is typically of type String or Integer

getType

public Class getType(Object propertyKey)
              throws PropertyNotFoundException
Description copied from interface: IContentProvider
Returns java type of the given property

Specified by:
getType in interface IContentProvider
Parameters:
propertyKey - the property key of type String or Integer
Returns:
property java Class
Throws:
PropertyNotFoundException - if property is not supported

getValue

public Object getValue(Object propertyKey)
                throws EvaluationException,
                       PropertyNotFoundException
Description copied from interface: IContentProvider
Returns value of the given property

Specified by:
getValue in interface IContentProvider
Parameters:
propertyKey - the property key of type String or Integer
Returns:
value of the property, can be null
Throws:
EvaluationException - if error during property evaluation
PropertyNotFoundException - if property is not supported

hasProperty

public boolean hasProperty(Object propertyKey)
Description copied from interface: IContentProvider
Checks if the given property is supported by this content provider

Specified by:
hasProperty in interface IContentProvider
Parameters:
propertyKey - property key of type String or Integer
Returns:
true if property is supported

getXMLNode

protected abstract Node getXMLNode()
Wrapped DOM node.


getXPathAPI

protected CachedXPathAPI getXPathAPI()
Xalan xpath api context.


getXPathValue

protected Object getXPathValue(String xpath)
                        throws TransformerException
Evaluates the specified xpath for the wrapped dom node.

Throws:
TransformerException