@Override
public ObjectDataVector getInstances(final ObjectData pattern) {
final Vector<SerialOid> instances = loadInstances(pattern.getSpecification());
if (instances == null) {
return new ObjectDataVector();
}
final ObjectDataVector matches = new ObjectDataVector();
for (final SerialOid oid : instances) {
final ObjectData instanceData = (ObjectData) loadData(oid);
// TODO check loader first
if (instanceData == null) {
throw new IsisException("No data found for " + oid + " (possible missing file)");
}
if (matchesPattern(pattern, instanceData)) {
matches.addElement(instanceData);
}
}
return matches;
}