use of eu.esdihumboldt.hale.common.instance.model.TypeFilter in project hale by halestudio.
the class AbstractTableInstanceWriter method getInstanceCollection.
/**
* Call this to get an instance collection based on the selected Type
*
* @param typeName the QName of the typeDefinition
* @return The instance collection for the given type, can be empty
* collection
*/
protected InstanceCollection getInstanceCollection(QName typeName) {
if (typeName == null) {
return getInstances();
}
// get all instances of the selected Type
InstanceCollection instances = null;
TypeDefinition selectedType = getTargetSchema().getType(typeName);
if (selectedType != null) {
instances = getInstances().select(new TypeFilter(selectedType));
} else
// if there is no selected type return random instance ???
instances = getInstances();
return instances;
}
Aggregations