NodeList index_elements = elem.getElementsByTagName("index");
for (int k = 0; k < index_elements.getLength(); k++)
{
elem = (Element) index_elements.item(k);
Index index = new Index(elem.getAttribute("name"));
NodeList indexfield_elements = elem.getElementsByTagName("indexfield");
for (int l = 0; l < indexfield_elements.getLength(); l++)
{
elem = (Element) indexfield_elements.item(l);
Field f = entity.getField(elem.getAttribute("name"));
if (f == null)
{
// System.err.println(String.format(Error.
// MISSING_INDEX_FIELD.msg,
// elem.getAttribute("name")));
throw new MolgenisModelException("Missing index field: " + elem.getAttribute("name"));
// return null;
}
try
{
index.addField(elem.getAttribute("name"));
}
catch (Exception e)
{
throw new MolgenisModelException(e.getMessage());
}