* @throws XmlReaderException if there is a problem with the reader.
*/
private XmlReadHandler findHandlerForClass(final Class classToRead, final Attributes atts,
final ArrayList history)
throws XmlReaderException {
final ObjectFactory genericFactory = getFactoryLoader();
if (history.contains(classToRead)) {
throw new IllegalStateException("Circular reference detected: " + history);
}
history.add(classToRead);
// check the manual mappings ...
ManualMappingDefinition manualDefinition =
this.classToHandlerMapping.getManualMappingDefinition(classToRead);
if (manualDefinition == null) {
manualDefinition = genericFactory.getManualMappingDefinition(classToRead);
}
if (manualDefinition != null) {
// Log.debug ("Locating handler for " + manualDefinition.getBaseClass());
return loadHandlerClass(manualDefinition.getReadHandler());
}