@Test public void testExtractMetadata_withDuplicateNamedElements() { final MetadataElement secondary = new MetadataElement("secondary"); final MetadataElement third_1 = new MetadataElement("third"); third_1.addAttribute(new MetadataAttribute("att_3_1", ProductData.ASCII.createInstance("Wilhelm"), true)); final MetadataElement third_2 = new MetadataElement("third"); third_2.addAttribute(new MetadataAttribute("att_3_1", ProductData.ASCII.createInstance("Busch"), true)); secondary.addElement(third_1); secondary.addElement(third_2); metadataRoot.addElement(secondary); final Properties properties = AbstractFormatExporter.extractMetadata(metadataRoot); assertEquals(2, properties.size()); assertEquals("Wilhelm", properties.getProperty("secondary:third_0:att_3_1")); assertEquals("Busch", properties.getProperty("secondary:third_1:att_3_1")); }
static Properties extractMetadata(MetadataElement root) { final Properties properties = new Properties(); extractAttributes(root, properties, ""); return properties; }
AbstractFormatExporter implements FormatExporter { static Properties extractMetadata(MetadataElement root) { final Properties properties = new Properties(); extractAttributes(root, properties, ""); return properties; } }
AbstractFormatExporter implements FormatExporter { static Properties extractMetadata(MetadataElement root) { final Properties properties = new Properties(); extractAttributes(root, properties, ""); return properties; }  }
AbstractFormatExporter implements FormatExporter { static Properties extractMetadata(MetadataElement root) { final Properties properties = new Properties(); extractAttributes(root, properties, ""); return properties; }  @Override void initialize(Product product, ExportParameter exportParameter); @Override void prepareGeographicSubset(NFileWriteable nFileWriteable, ExportParameter exportParameter); @Override void addGlobalAttributes(NFileWriteable nFileWriteable, MetadataElement metadataRoot, ExportParameter exportParameter); @Override void addVariables(NFileWriteable nFileWriteable, ExportParameter exportParameter); @Override abstract void addDimensions(NFileWriteable nFileWriteable); }
AbstractFormatExporter implements FormatExporter { static Properties extractMetadata(MetadataElement root) { final Properties properties = new Properties(); extractAttributes(root, properties, ""); return properties; }  @Override void initialize(Product product, ExportParameter exportParameter); @Override void prepareGeographicSubset(NFileWriteable nFileWriteable, ExportParameter exportParameter); @Override void addGlobalAttributes(NFileWriteable nFileWriteable, MetadataElement metadataRoot, ExportParameter exportParameter); @Override void addVariables(NFileWriteable nFileWriteable, ExportParameter exportParameter); @Override abstract void addDimensions(NFileWriteable nFileWriteable);  }