XMLHelper helper = new XMLHelper(document, fileName, m_loader);
// Process the entity mappings ... this is a crude way of doing
// things ... but hey ... the clock is ticking ...
MetadataDescriptor desc = m_project.getDescriptors().iterator().next();
XMLClassAccessor dummyAccessor = new XMLClassAccessor(new MetadataClass(desc.getJavaClass()), null, helper, this, desc);
dummyAccessor.processEntityMappings();
// Process the entity nodes for this xml document.
NodeList entityNodes = helper.getNodes(XMLConstants.ENTITY_MAPPINGS, XMLConstants.ENTITY);
if (entityNodes != null) {
for (int i = 0; i < entityNodes.getLength(); i++) {
Node entityNode = entityNodes.item(i);
Class entityClass = helper.getClassForNode(entityNode);
MetadataDescriptor descriptor = m_project.getDescriptor(entityClass);
// Process all descriptors that are in our project.
ClassAccessor accessor = descriptor.getClassAccessor();
// If there is no accessor on this descriptor then it has not
// been processed yet. Create one and process it.
if (accessor == null) {
accessor = new XMLClassAccessor(new MetadataClass(descriptor.getJavaClass()), entityNode, helper, this, descriptor);
descriptor.setClassAccessor(accessor);
accessor.process();
}
}
}