public void fromJDOM(Element element) { /* Mistake? // Ensure we have matching pairs List<?> property_refs = element.getChildren(LDModelFactory.PROPERTY_REF, IMSLD_NAMESPACE_100_EMBEDDED); List<?> property_values = element.getChildren(LDModelFactory.PROPERTY_VALUE, IMSLD_NAMESPACE_100_EMBEDDED); if(property_refs != null && property_values != null && property_refs.size() == property_values.size()) { for(int i = 0; i < property_refs.size(); i++) { IPropertyRefValuePair refvalue = new PropertyRefValuePair(fLDModel); refvalue.getPropertyRef().fromJDOM((Element)property_refs.get(i)); refvalue.getPropertyValue().fromJDOM((Element)property_values.get(i)); fPropertyRefValuePairs.add(refvalue); } } */ Element property_ref = element.getChild(LDModelFactory.PROPERTY_REF, IMSLD_NAMESPACE_100_EMBEDDED); if (property_ref != null) { fPropertyRefValuePair.getPropertyRef().fromJDOM(property_ref); } Element property_value = element.getChild(LDModelFactory.PROPERTY_VALUE, IMSLD_NAMESPACE_100_EMBEDDED); if (property_value != null) { fPropertyRefValuePair.getPropertyValue().fromJDOM(property_value); } }
public Element toJDOM() { Element element = new Element(getTagName(), IMSLD_NAMESPACE_100_EMBEDDED); /* Mistake? for(IPropertyRefValuePair refvalue : fPropertyRefValuePairs) { Element property_ref = refvalue.getPropertyRef().toJDOM(); element.addContent(property_ref); Element property_value = refvalue.getPropertyValue().toJDOM(); element.addContent(property_value); } */ Element property_ref = fPropertyRefValuePair.getPropertyRef().toJDOM(); element.addContent(property_ref); Element property_value = fPropertyRefValuePair.getPropertyValue().toJDOM(); element.addContent(property_value); return element; }