1 package net.sourceforge.phpeclipse.xdebug.php.model;
3 import java.util.ArrayList;
5 import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
7 import org.eclipse.debug.core.DebugException;
8 import org.eclipse.debug.core.model.IVariable;
9 import org.w3c.dom.Node;
10 import org.w3c.dom.NodeList;
12 public class XDebugObjectValue extends XDebugAbstractValue {
13 private int NumChildren;
15 public XDebugObjectValue(XDebugStackFrame variable, Node value) throws DebugException {
16 super(variable, value);
19 if (!PHPDebugUtils.getAttributeValue(value, "numchildren").equals("")) {
20 NumChildren = Integer.parseInt(PHPDebugUtils.getAttributeValue(value, "numchildren"));
23 if (NumChildren > 0) {
24 NodeList property = value.getChildNodes();
26 ArrayList a = new ArrayList();
27 for (int i = 0; i < property.getLength(); i++) {
28 Node propertyNode = property.item(i);
30 * Eliminate CLASSNAME duplicate from object properties.
31 * see http://bugs.xdebug.org/view.php?id=518
32 * and http://svn.xdebug.org/cgi-bin/viewvc.cgi/xdebug/trunk/xdebug_var.c?root=xdebug&r1=2962&r2=2996
34 String encoding = PHPDebugUtils.getAttributeValue(propertyNode, "encoding");
35 if (encoding.equals("base64")) {
36 a.add(new XDebugVariable(variable, propertyNode));
40 setChildren((IVariable[])a.toArray(new IVariable[a.size()]));
43 String className = PHPDebugUtils.getAttributeValue(value,"classname");
44 if(!"".equals(className)) {
45 setValueString(className);