Package org.geotools.data.complex
Class AbstractMappingFeatureIterator
- Object
-
- AbstractMappingFeatureIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<Feature>
,IMappingFeatureIterator
,FeatureIterator<Feature>
- Direct Known Subclasses:
DataAccessMappingFeatureIterator
public abstract class AbstractMappingFeatureIterator extends Object implements IMappingFeatureIterator
Base class for several MappingFeatureImplementation's.- Author:
- Russell Petty (GeoScience Victoria)
-
-
Field Summary
Fields Modifier and Type Field Description protected FeatureFactory
attf
Factory used to create the target feature and attributesprotected int
dataMaxFeatures
maximum number of features to request when running the data(base?)protected int
featureCounter
counter to ensure maxFeatures is not exceededprotected FilterFactory
filterFac
protected FeatureTypeFactory
ftf
static GeometryFactory
GEOMETRY_FACTORY
protected boolean
includeMandatory
protected static Logger
LOGGER
The logger for the filter module.protected FeatureTypeMapping
mapping
The mappings for the source and target schemasstatic String
MULTI_VALUE_TYPE
Key value for Attribute userData Map for indicating the presence of a multi value classifier.protected FilterFactory
namespaceAwareFilterFactory
protected NamespaceSupport
namespaces
protected Query
query
protected int
requestMaxFeatures
maxFeatures restriction value as provided by query.static long
RESOLVE_TIMEOUT_POLL_INTERVAL
Milliseconds between polls of resolver thread.protected int
resolveDepth
protected Integer
resolveTimeOut
protected List<AttributeMapping>
selectedMapping
Mappings after Property Selection is appliedprotected Map<AttributeMapping,List<PropertyName>>
selectedProperties
Selected Properties for Feature Chainingprotected AppSchemaDataAccess
store
protected Transaction
transaction
static String
UNBOUNDED_MULTI_VALUE
Value for Attribute userData Map for indicating an anonymous unbounded sequence classifier.static Name
XLINK_HREF_NAME
Name representation of xlink:hrefprotected XPath
xpathAttributeBuilder
-
Constructor Summary
Constructors Constructor Description AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query)
AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery)
AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean hasPostFilter)
AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean removeQueryLimitIfDenormalised, boolean hasPostFilter)
AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean removeQueryLimitIfDenormalised, boolean hasPostFilter, Transaction tx)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the underlying FeatureIteratorprotected abstract void
closeSourceFeatures()
protected abstract Feature
computeNext()
protected abstract String
extractIdForAttribute(Expression idExpression, Object sourceInstance)
Based on the set of xpath expression/id extracting expression, finds the ID for the attributeidExpression
from the source complex attribute.protected Map<Name,Expression>
getClientProperties(Property attribute)
protected abstract FeatureIterator<? extends Feature>
getSourceFeatureIterator()
Transaction
getTransaction()
protected Query
getUnrolledQuery(Query query)
Return a query appropriate to its underlying feature source.protected abstract Object
getValue(Expression expression, Object sourceFeature)
abstract boolean
hasNext()
Does another Feature exist in this Iteration.protected abstract void
initialiseSourceFeatures(FeatureTypeMapping mapping, Query query, CoordinateReferenceSystem crs)
protected boolean
isHasNextCalled()
protected abstract boolean
isNextSourceFeatureNull()
protected abstract boolean
isSourceFeatureIteratorNull()
Feature
next()
Return next feature.protected abstract Feature
populateFeatureData(String id)
protected static String
referenceToIdentifier(String reference)
void
remove()
Shall not be called, just throws an UnsupportedOperationExceptionprotected Attribute
setAttributeContent(Attribute target, XPathUtil.StepList xpath, Object value, String id, AttributeType targetNodeType, boolean isXlinkRef, Expression sourceExpression, Object source, Map<Name,Expression> clientProperties, boolean ignoreXlinkHref)
protected void
setClientProperties(Attribute target, Object source, Map<Name,Expression> clientProperties)
protected void
setGeometryUserData(Attribute target, Map<Name,Object> targetAttributes)
protected void
setHasNextCalled(boolean hasNextCalled)
protected abstract boolean
sourceFeatureIteratorHasNext()
protected abstract boolean
unprocessedFeatureExists()
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface Iterator
forEachRemaining
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
The logger for the filter module.
-
GEOMETRY_FACTORY
public static final GeometryFactory GEOMETRY_FACTORY
-
filterFac
protected FilterFactory filterFac
-
ftf
protected FeatureTypeFactory ftf
-
XLINK_HREF_NAME
public static final Name XLINK_HREF_NAME
Name representation of xlink:href
-
MULTI_VALUE_TYPE
public static final String MULTI_VALUE_TYPE
Key value for Attribute userData Map for indicating the presence of a multi value classifier.- See Also:
- Constant Field Values
-
UNBOUNDED_MULTI_VALUE
public static final String UNBOUNDED_MULTI_VALUE
Value for Attribute userData Map for indicating an anonymous unbounded sequence classifier.- See Also:
- Constant Field Values
-
RESOLVE_TIMEOUT_POLL_INTERVAL
public static final long RESOLVE_TIMEOUT_POLL_INTERVAL
Milliseconds between polls of resolver thread.- See Also:
- Constant Field Values
-
mapping
protected FeatureTypeMapping mapping
The mappings for the source and target schemas
-
selectedMapping
protected List<AttributeMapping> selectedMapping
Mappings after Property Selection is applied
-
selectedProperties
protected Map<AttributeMapping,List<PropertyName>> selectedProperties
Selected Properties for Feature Chaining
-
includeMandatory
protected boolean includeMandatory
-
attf
protected FeatureFactory attf
Factory used to create the target feature and attributes
-
store
protected AppSchemaDataAccess store
-
xpathAttributeBuilder
protected final XPath xpathAttributeBuilder
-
namespaceAwareFilterFactory
protected FilterFactory namespaceAwareFilterFactory
-
requestMaxFeatures
protected final int requestMaxFeatures
maxFeatures restriction value as provided by query. After the data query has run, *this* limit is also applied to the result.
-
dataMaxFeatures
protected final int dataMaxFeatures
maximum number of features to request when running the data(base?) query. For denormalised data sources, this neesd to be be Query.DEFAULT_MAX to trigger a full table scan. In all other cases it will be the same value as requestMaxFeatures
-
featureCounter
protected int featureCounter
counter to ensure maxFeatures is not exceeded
-
namespaces
protected NamespaceSupport namespaces
-
resolveDepth
protected int resolveDepth
-
resolveTimeOut
protected Integer resolveTimeOut
-
transaction
protected Transaction transaction
-
query
protected Query query
-
-
Constructor Detail
-
AbstractMappingFeatureIterator
public AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query) throws IOException
- Throws:
IOException
-
AbstractMappingFeatureIterator
public AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery) throws IOException
- Throws:
IOException
-
AbstractMappingFeatureIterator
public AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean hasPostFilter) throws IOException
- Throws:
IOException
-
AbstractMappingFeatureIterator
public AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean removeQueryLimitIfDenormalised, boolean hasPostFilter) throws IOException
- Throws:
IOException
-
AbstractMappingFeatureIterator
public AbstractMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean removeQueryLimitIfDenormalised, boolean hasPostFilter, Transaction tx) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getTransaction
public Transaction getTransaction()
-
remove
public void remove()
Shall not be called, just throws an UnsupportedOperationException
-
close
public void close()
Closes the underlying FeatureIterator- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFeatureIterator<Feature>
-
extractIdForAttribute
protected abstract String extractIdForAttribute(Expression idExpression, Object sourceInstance)
Based on the set of xpath expression/id extracting expression, finds the ID for the attributeidExpression
from the source complex attribute.- Parameters:
idExpression
- the location path of the attribute to be created, for which to obtain the id by evaluating the correspondingorg.geotools.filter.Expression
fromsourceInstance
.sourceInstance
- a complex attribute which is the source of the mapping.- Returns:
- the ID to be applied to a new attribute instance addressed by
attributeXPath
, ornull
if there is no an id mapping for that attribute.
-
getUnrolledQuery
protected Query getUnrolledQuery(Query query)
Return a query appropriate to its underlying feature source.- Parameters:
query
- the original query against the output schema- Returns:
- a query appropriate to be executed over the underlying feature source.
-
isHasNextCalled
protected boolean isHasNextCalled()
-
setHasNextCalled
protected void setHasNextCalled(boolean hasNextCalled)
-
next
public Feature next()
Return next feature.- Specified by:
next
in interfaceFeatureIterator<Feature>
- Specified by:
next
in interfaceIterator<Feature>
- Returns:
- The next Feature
- See Also:
Iterator.next()
-
getClientProperties
protected Map<Name,Expression> getClientProperties(Property attribute) throws DataSourceException
- Throws:
DataSourceException
-
setAttributeContent
protected Attribute setAttributeContent(Attribute target, XPathUtil.StepList xpath, Object value, String id, AttributeType targetNodeType, boolean isXlinkRef, Expression sourceExpression, Object source, Map<Name,Expression> clientProperties, boolean ignoreXlinkHref)
-
setClientProperties
protected void setClientProperties(Attribute target, Object source, Map<Name,Expression> clientProperties)
-
setGeometryUserData
protected void setGeometryUserData(Attribute target, Map<Name,Object> targetAttributes)
-
closeSourceFeatures
protected abstract void closeSourceFeatures()
-
getSourceFeatureIterator
protected abstract FeatureIterator<? extends Feature> getSourceFeatureIterator()
-
initialiseSourceFeatures
protected abstract void initialiseSourceFeatures(FeatureTypeMapping mapping, Query query, CoordinateReferenceSystem crs) throws IOException
- Throws:
IOException
-
unprocessedFeatureExists
protected abstract boolean unprocessedFeatureExists()
-
sourceFeatureIteratorHasNext
protected abstract boolean sourceFeatureIteratorHasNext()
-
isNextSourceFeatureNull
protected abstract boolean isNextSourceFeatureNull()
-
populateFeatureData
protected abstract Feature populateFeatureData(String id) throws IOException
- Throws:
IOException
-
getValue
protected abstract Object getValue(Expression expression, Object sourceFeature)
-
isSourceFeatureIteratorNull
protected abstract boolean isSourceFeatureIteratorNull()
-
computeNext
protected abstract Feature computeNext() throws IOException
- Throws:
IOException
-
hasNext
public abstract boolean hasNext()
Description copied from interface:FeatureIterator
Does another Feature exist in this Iteration.Iterator defin: Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
-
-