- table.setRowData(new String[][] { //
- new String[] { " Author", meta.getAuthor() }, //
- new String[] { " Publication date", formatDate(meta.getDate()) },
- new String[] { " Word count", format(meta.getWords()) },
- new String[] { " Source", meta.getSource() } //
- });
- table.setHeaders(Arrays.asList("key", "value"), false);
- table.toTop();
- }
-
- private String format(long value) {
- String display = "";
-
- while (value > 0) {
- if (!display.isEmpty()) {
- display = "." + display;
- }
- display = (value % 1000) + display;
- value = value / 1000;
- }
-
- return display;
- }
-
- private String formatDate(String date) {
- long ms = 0;
-
- try {
- ms = StringUtils.toTime(date);
- } catch (ParseException e) {
- }
-
- if (ms <= 0) {
- SimpleDateFormat sdf = new SimpleDateFormat(
- "yyyy-MM-dd'T'HH:mm:ssXXX");
- try {
- ms = sdf.parse(date).getTime();
- } catch (ParseException e) {
- }
+ Map<String, String> metaDesc = BasicReader.getMetaDesc(meta);
+ String[][] metaDescObj = new String[metaDesc.size()][2];
+ int i = 0;
+ for (String key : metaDesc.keySet()) {
+ metaDescObj[i][0] = " " + key;
+ metaDescObj[i][1] = metaDesc.get(key);
+ i++;