public final void save(final Data data) {
writeInstanceToItsDataFile(data);
}
private void writeInstanceToItsDataFile(final Data data) {
xmlFile.writeXml(filename(data.getOid()), new ContentWriter() {
@Override
public void write(final Writer writer) throws IOException {
final StringBuffer xml = new StringBuffer();
final boolean isObject = data instanceof ObjectData;
final String tag = isObject ? "isis" : "collection";