return valueClasses;
}
private static JDBCValueClassMetaData parseValueClass(final XMLStreamReader reader, final ClassLoader classLoader) throws XMLStreamException {
final Map<String, JDBCValuePropertyMetaData> properties = new HashMap<String, JDBCValuePropertyMetaData>();
final JDBCValueClassMetaData valueClass = new JDBCValueClassMetaData();
for (Element element : children(reader)) {
switch (element) {
case CLASS: {
final String type = getElementText(reader);
try {
valueClass.setClass(classLoader.loadClass(type));
} catch (ClassNotFoundException e) {
throw MESSAGES.failedToLoadValueClass(type, e);
}
break;
}
case PROPERTY: {
parseValueProperty(reader, properties);
break;
}
case DESCRIPTION: {
getElementText(reader);
break;
}
default: {
throw unexpectedElement(reader);
}
}
}
for (String propertyName : properties.keySet()) {
final JDBCValuePropertyMetaData propertyMetaData = properties.get(propertyName);
propertyMetaData.setPropertyName(propertyName, valueClass.getJavaType());
valueClass.addProperty(propertyMetaData);
}
return valueClass;
}