public ObjectDataVector getInstances(final ObjectData pattern) {
final Vector<RootOid> instances = loadInstances(pattern.getSpecification(getSpecificationLoader()));
if (instances == null) {
return new ObjectDataVector();
}
final ObjectDataVector matches = new ObjectDataVector();
for (final RootOid 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;
}