* @param asset
* @return
*/
@SuppressWarnings("unchecked")
public AssetData parseAsset(final Element asset) {
final AssetData assetData = new AssetData();
for (final Element child : asset.getChildren()) {
if ("contributor".equals(child.getName())) {
parseContributor(assetData, child);
} else if ("created".equals(child.getName())) {
assetData.setCreated(child.getText());
} else if ("keywords".equals(child.getName())) {
assetData.setKeywords(child.getText());
} else if ("modified".equals(child.getName())) {
assetData.setModified(child.getText());
} else if ("revision".equals(child.getName())) {
assetData.setRevision(child.getText());
} else if ("subject".equals(child.getName())) {
assetData.setSubject(child.getText());
} else if ("title".equals(child.getName())) {
assetData.setTitle(child.getText());
} else if ("unit".equals(child.getName())) {
final String name = child.getAttributeValue("name");
if (name != null) {
assetData.setUnitName(name);
}
final String meter = child.getAttributeValue("meter");
if (meter != null) {
assetData.setUnitMeter(Float.parseFloat(meter.replace(",", ".")));
}
} else if ("up_axis".equals(child.getName())) {
final String axis = child.getText();
if ("X_UP".equals(axis)) {
assetData.setUpAxis(new Vector3());
} else if ("Y_UP".equals(axis)) {
assetData.setUpAxis(Vector3.UNIT_Y);
} else if ("Z_UP".equals(axis)) {
assetData.setUpAxis(Vector3.UNIT_Z);
}
}
}
return assetData;