*
* @throws IOException if there is an I/O problem.
*/
public synchronized void write(final String target) throws IOException {
final DescriptionModel model = getModel();
this.sources = new ArrayList(Arrays.asList(model.getSources()));
this.targetFile = new File(target);
this.plainFileName = IOUtils.getInstance().stripFileExtension(this.targetFile.getName());
this.extension = IOUtils.getInstance().getFileExtension(target);
// split into classDescriptionByPackage ...
this.classDescriptionByPackage = new HashNMap();
for (int i = 0; i < model.size(); i++) {
final ClassDescription cd = model.get(i);
if (cd.getSource() == null) {
final String packageName = getPackage(cd.getObjectClass());
final String includeFileName = this.plainFileName + "-" + packageName
+ this.extension;
this.classDescriptionByPackage.add(includeFileName, cd);
}
else {
this.classDescriptionByPackage.add(cd.getSource(), cd);
}
}
final MappingModel mappingModel = model.getMappingModel();
// split manual mappings into packages ...
final ManualMappingInfo[] manualMappings = mappingModel.getManualMapping();
this.manualMappingByPackage = new HashNMap();
for (int i = 0; i < manualMappings.length; i++) {