Collection classes = configurator.getMappedBy(notMapped);
if (classes != null) {
notMapped.removeAll(classes);
if (LOG.isDebugEnabled()) {
for (Iterator iter = classes.iterator(); iter.hasNext(); ) {
GrailsDomainClass grailsDomainClass = (GrailsDomainClass) iter.next();
LOG.debug("Mapping class [" + grailsDomainClass.getClazz().getName() + "] with strategy [" + configurator.getName() + "]");
}
}
classesByStrategy.put(classMappingConfigurators[i], classes);
mappableClasses.addAll(classes);
}
}
// Deal with any domain classes configured through the application's runtime
// config. This is treated differently to the other configuration options
// because it can override existing mapping information. Also, it requires
// access to the application config object.
AppConfigClassMapper overrideClassMapper = new AppConfigClassMapper(grailsApplication.getConfig());
overrideClassMapper.init(compassConfiguration, (Map) configurationContext.get("customConverters"), defaultExcludes, defaultFormats);
AppConfigMappingConfigurator appConfigConfigurator = new AppConfigMappingConfigurator(grailsApplication.getConfig());
appConfigConfigurator.setMappingDescriptionProviderManager(overrideClassMapper);
appConfigConfigurator.setCompassClassMappingXmlBuilder(classMappingXmlBuilder);
Collection appConfigMapped = appConfigConfigurator.getMappedBy(grailsDomainClasses);
mappableClasses.addAll(appConfigMapped);
// Check whether search has been explicitly removed from any domain classes.
Collection unmapped = appConfigConfigurator.getUnmapped(grailsDomainClasses);
mappableClasses.removeAll(unmapped);
notMapped.addAll(unmapped);
if (LOG.isDebugEnabled() && !notMapped.isEmpty()) {
for (Iterator iter = notMapped.iterator(); iter.hasNext(); ) {
GrailsDomainClass grailsDomainClass = (GrailsDomainClass) iter.next();
LOG.debug("No mapping strategy found for class [" + grailsDomainClass.getClazz().getName() + "]: assuming this class is not searchable");
}
}
// map classes in the order defined by the classMappingConfigurators
for (int i = 0; i < classMappingConfigurators.length; i++) {