This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 20849
Collapse All | Expand All

(-)storagemodel/BootReader.java (-3 / +7 lines)
Lines 571-581 Link Here
571
                throw new DebugException();
571
                throw new DebugException();
572
            }
572
            }
573
        } else {
573
        } else {
574
            value = decodeStringValue(XmiUtils.getXmiAttrValueAsString(node, feature.getName()), metaType, dataType);
575
            if (feature.isMultivalued()) {
574
            if (feature.isMultivalued()) {
576
                List x = new ArrayList();
575
                List vals = XmiUtils.getXmiMultiValueAsString(node, feature.getName());
577
                x.add(value);
576
                List x = new ArrayList(vals.size());
577
                for (Iterator it = vals.iterator(); it.hasNext(); ) {
578
                    x.add(decodeStringValue((String)it.next(), metaType, dataType));
579
                }
578
                value = x;
580
                value = x;
581
            } else {
582
                value = decodeStringValue(XmiUtils.getXmiAttrValueAsString(node, feature.getName()), metaType, dataType);
579
//                    System.out.println("multivalued: " + feature.getName() + ", " + value);
583
//                    System.out.println("multivalued: " + feature.getName() + ", " + value);
580
            }
584
            }
581
        }
585
        }
(-)util/XmiUtils.java (+45 lines)
Lines 45-50 Link Here
45
        }
45
        }
46
        return result;
46
        return result;
47
    }
47
    }
48
    
49
    public static List getXmiMultiValueAsString(Node node, String attributeName) {
50
        List result = null;
51
        if (node != null) {
52
            // assume the MultiValued thing cannot be as an attribute...
53
            return getElementValueAsStringList( node, attributeName );
54
        }
55
        return result;
56
    }
48
57
49
    public static List getXmiRefValue(Node node, String attributeName) {
58
    public static List getXmiRefValue(Node node, String attributeName) {
50
        List value = new ArrayList();
59
        List value = new ArrayList();
Lines 93-98 Link Here
93
                    result = "";
102
                    result = "";
94
                } else {
103
                } else {
95
                    result = attributeNode.getNodeValue();
104
                    result = attributeNode.getNodeValue();
105
                }
106
            }
107
        }
108
        return result;
109
    }
110
111
    public static List getElementValueAsStringList(Node node, String attributeName) {
112
        List result = null;
113
        if (node != null) {
114
            List l = getChildNodeList( node, attributeName );
115
            if (l != null) {
116
                result = new ArrayList(l.size());
117
                for (Iterator it = l.iterator(); it.hasNext(); ) {
118
                    Node attributeNode = ((Node)it.next()).getFirstChild();
119
                    if (attributeNode == null) {
120
                        result.add("");
121
                    } else {
122
                        result.add(attributeNode.getNodeValue());
123
                    }
124
                }
125
            }
126
        }
127
        return result;
128
    }
129
130
    public static List getChildNodeList(Node parentNode, String childNodeName) {
131
        List result = null;
132
        if ((parentNode != null) && (childNodeName != null)) {
133
            NodeList children = parentNode.getChildNodes();
134
            for (int cnt = 0; cnt < children.getLength(); cnt++) {
135
                Node child = children.item(cnt);
136
                // [PENDING] this is ugly !!! namespaces should be resolved correctly
137
                if (childNodeName.equals(resolveFullName(child))) {
138
                    if (result == null)
139
                        result = new LinkedList();
140
                    result.add(child);
96
                }
141
                }
97
            }
142
            }
98
        }
143
        }

Return to bug 20849