ArrayList values = new ArrayList();
for (int i = 0; (texts != null) && (i < texts.size()); i++) {
try {
Element text = (Element) texts.get(i);
Time start = (text.getAttributeValue("start") == null)
? null : new Time(text.getAttributeValue("start"));
Time end = (text.getAttributeValue("end") == null) ? null
: new Time(text.getAttributeValue(
"end"));
values.add(new Text(text.getAttributeValue("type"),
text.getTextTrim(), start, end));
} catch (Exception ex) {
LOG.log(Level.WARNING, "Exception parsing text tag.", ex);
}
}
md.setText((Text[]) values.toArray(new Text[values.size()]));
}
// thumbnails
{
List thumbnails = e.getChildren("thumbnail", getNS());
ArrayList values = new ArrayList();
for (int i = 0; (thumbnails != null) && (i < thumbnails.size());
i++) {
try {
Element thumb = (Element) thumbnails.get(i);
Time t = (thumb.getAttributeValue("time") == null) ? null
: new Time(thumb.getAttributeValue(
"time"));
Integer width = (thumb.getAttributeValue("width") == null)
? null : new Integer(thumb.getAttributeValue("width"));
Integer height = (thumb.getAttributeValue("height") == null)
? null : new Integer(thumb.getAttributeValue("height"));