public XmlSnapshot build() {
final ObjectAdapter adapter = getAdapterMap().adapterFor(snapshottable);
final XmlSnapshot snapshot = (schema != null) ? new XmlSnapshot(adapter, schema) : new XmlSnapshot(adapter);
for (final XmlSnapshotBuilder.PathAndAnnotation paa : paths) {
if (paa.annotation != null) {
snapshot.include(paa.path, paa.annotation);
} else {
snapshot.include(paa.path);
}
}
return snapshot;