Author: bargull
Date: 2008-02-13 16:40:55 -0800 (Wed, 13 Feb 2008)
New Revision: 8020
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
Log:
Change 20071116-bargull-2 by [EMAIL PROTECTED] on 2007-11-16 00:27:11
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add support for retrieving "nodeType" to LzDatapointer
New Features:
Bugs Fixed:
LPP-5036 - Add getter-method for "nodeType" in LzDatapointer
Technical Reviewer: hminsky
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Almost every LzDataNode field/method can be retrieved through a
LzDatapointer-method (nodeName -> getNodeName, attrs -> getNodeAttribute,
etc.). But you cannot ask for the node-type of the node the datapointer is
pointing to through a LzDatapointer-method. That means you need to access the
"p"-field of a LzDatapointer directly to get this info (dp.p.nodeType with dp
instanceof LzDatapointer and dp.p instanceof LzDataNode). This quite
inconsistent compared to the rest of the LzDatapointer-API and should be
changed.
This changeset enhances the LzDatapointer-API by introducing a new method to
handle this issue (LzDatapointer#getNodeType()).
Tests:
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2008-02-13
23:16:27 UTC (rev 8019)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2008-02-14
00:40:55 UTC (rev 8020)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @topic LFC
@@ -892,6 +892,23 @@
}
/**
+ * Gets the nodeType of the node that the datapointer is pointing to.
+ * @return Integer: one of LzDataNode.ELEMENT_NODE, LzDataNode.TEXT_NODE,
+ * LzDataNode.DOCUMENT_NODE or <code>undefined</code> if this datapointer
+ * does not point to a valid node
+ */
+function getNodeType (){
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.info("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
+
+ return this.p.nodeType;
+}
+
+/**
* Gets the name of the node that the datapointer is pointing to.
* @return String: The name of the datapointer's node
*/
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins