@Test public void testExtractMetadata_mixedLevel() { final MetadataElement secondary = new MetadataElement("secondary"); final MetadataElement third = new MetadataElement("third"); third.addAttribute(new MetadataAttribute("att_3_1", ProductData.ASCII.createInstance("yeah_3"), true)); third.addAttribute(new MetadataAttribute("att_3_2", ProductData.ASCII.createInstance("yeah_4"), true)); secondary.addElement(third); secondary.addAttribute(new MetadataAttribute("att_2", ProductData.ASCII.createInstance("yeah_5"), true)); metadataRoot.addElement(secondary); metadataRoot.addAttribute(new MetadataAttribute("root_1", ProductData.ASCII.createInstance("yeah_6"), true)); metadataRoot.addAttribute(new MetadataAttribute("root_2", ProductData.ASCII.createInstance("yeah_7"), true)); final Properties properties = AbstractFormatExporter.extractMetadata(metadataRoot); assertEquals(5, properties.size()); assertEquals("yeah_3", properties.getProperty("secondary:third:att_3_1")); assertEquals("yeah_4", properties.getProperty("secondary:third:att_3_2")); assertEquals("yeah_5", properties.getProperty("secondary:att_2")); assertEquals("yeah_6", properties.getProperty("root_1")); assertEquals("yeah_7", properties.getProperty("root_2")); }
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);  }