Search in sources :

Example 6 with TypeFilter

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;
}
Also used : InstanceCollection(eu.esdihumboldt.hale.common.instance.model.InstanceCollection) TypeFilter(eu.esdihumboldt.hale.common.instance.model.TypeFilter) TypeDefinition(eu.esdihumboldt.hale.common.schema.model.TypeDefinition)

Aggregations

InstanceCollection (eu.esdihumboldt.hale.common.instance.model.InstanceCollection)6 TypeFilter (eu.esdihumboldt.hale.common.instance.model.TypeFilter)6 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)3 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)3 Geometry (com.vividsolutions.jts.geom.Geometry)1 IOProviderConfigurationException (eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException)1 IOMessageImpl (eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl)1 InstanceCollection2 (eu.esdihumboldt.hale.common.instance.model.ext.InstanceCollection2)1 EmptyInstanceCollection (eu.esdihumboldt.hale.common.instance.model.ext.helper.EmptyInstanceCollection)1 DefaultInstanceCollection (eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection)1 GeometryProperty (eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty)1 Schema (eu.esdihumboldt.hale.common.schema.model.Schema)1 InstanceService (eu.esdihumboldt.hale.ui.service.instance.InstanceService)1 IOException (java.io.IOException)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 QName (javax.xml.namespace.QName)1 Test (org.junit.Test)1