Hello all

This is a minor details, but all metadata should now have 'toString()' representation. An example is like below (needs UTF-8 encoding and monospaced font for proper output). This example does not show much geographic stuff, but other ISO 19115 objects are more clearly geographic.

DefaultCitation
  ├─Title…………………………………………………………………………………… Some title
  ├─Alternate title (1 of 2)………………………………… First alternate title
  ├─Alternate title (2 of 2)………………………………… Second alternate title
  ├─Edition……………………………………………………………………………… Some edition
  ├─Cited responsible party (1 of 2)
  │   ├─Organisation name………………………………………… Some organisation
  │   └─Role…………………………………………………………………………… Distributor
  ├─Cited responsible party (2 of 2)
  │   ├─Individual name……………………………………………… Some person of contact
  │   ├─Contact info
  │   │   └─Address
  │   │       └─Electronic mail address…… Some email
  │   └─Role…………………………………………………………………………… Point of contact
  ├─Presentation form (1 of 2)…………………………… Map digital
  ├─Presentation form (2 of 2)…………………………… Map hardcopy
  └─Other citation details……………………………………… Some other details


Up to now all "toString()" implementations were formatting in Locale.ROOT (kind of "unlocalized" locale, very similar to Locale.ENGLISH except for a few things like dates). This is because 'toString()' were mostly for debugging purposes and were intended to be parseable for example by the org.apache.sis.measure.Angle(String) constructor. However since I don't think that anyone will try to parse String representation of metadata (if one want to do that, he should use XML instead), I wonder if we should use Locale.getDefault() in the metadata case? This impact number and date formatting, and some labels for which a translation is available.

Same question apply to timezone, currently fixed at UTC for AbstractMetadata.toString(). I wonder if we should use the locale timezone...

Note that this is just for developer convenience. If such output is desired for end-user, then the steps are to get a TreeTable representation of the metadata, configure a TreeTableFormat and use it like below:

AbstractMetadata myMetadata = ...; // Any of the ~80 available subclasses.
    TreeTable treeTableViewOfMyMetadata = metadata.asTreeTable();
    TreeTableFormat format = new TreeTableFormat(myLocale, myTimezone);
    String s = format.format(treeTableViewOfMyMetadata);



    Martin

Reply via email to