throw new TableEngineException("could not load engine", e);
}
}
private Entity parseEntity(Node node) throws TableEngineException {
Entity entity = new Entity();
NamedNodeMap attributes = node.getAttributes();
for(int i=0; i<attributes.getLength(); i++) {
Node attributeNode = attributes.item(i);
if(attributeNode.getNodeType() == Node.ATTRIBUTE_NODE) {
String name = attributeNode.getNodeName();
if("class".equals(name)) {
try {
entity.setClazz((Class<? extends BaseVO>)Class.forName(attributeNode.getNodeValue()));
} catch(ClassNotFoundException e) {
throw new TableEngineException(e);
}
} else if("alias".equals(name)) {
entity.setAlias(attributeNode.getNodeValue());
} else if("messageKey".equals(name)) {
entity.setMessageKey(attributeNode.getNodeValue());
}
}
}
return entity;