public class DataAccessMappingFeatureIterator extends AbstractMappingFeatureIterator
This iterator acts like a one-to-one mapping, producing a Feature of the target type for each feature of the source type.
Modifier and Type | Field and Description |
---|---|
protected Feature |
curSrcFeature
This is the feature that will be processed in next()
|
protected List<Expression> |
foreignIds |
protected FeatureSource<? extends FeatureType,? extends Feature> |
mappedSource |
protected CoordinateReferenceSystem |
reprojection
Reprojected CRS from the source simple features, or null
|
protected FeatureCollection<? extends FeatureType,? extends Feature> |
sourceFeatures |
protected AttributeDescriptor |
targetFeature |
attf, dataMaxFeatures, featureCounter, filterFac, ftf, includeMandatory, LOGGER, mapping, namespaceAwareFilterFactory, namespaces, query, requestMaxFeatures, RESOLVE_TIMEOUT_POLL_INTERVAL, resolveDepth, resolveTimeOut, selectedMapping, selectedProperties, store, transaction, XLINK_HREF_NAME, xpathAttributeBuilder
Constructor and Description |
---|
DataAccessMappingFeatureIterator(AppSchemaDataAccess store,
FeatureTypeMapping mapping,
Query query) |
DataAccessMappingFeatureIterator(AppSchemaDataAccess store,
FeatureTypeMapping mapping,
Query query,
boolean isFiltered,
boolean removeQueryLimitIfDenormalised) |
DataAccessMappingFeatureIterator(AppSchemaDataAccess store,
FeatureTypeMapping mapping,
Query query,
boolean isFiltered,
boolean removeQueryLimitIfDenormalised,
boolean hasPostFilter) |
DataAccessMappingFeatureIterator(AppSchemaDataAccess store,
FeatureTypeMapping mapping,
Query query,
boolean isFiltered,
boolean removeQueryLimitIfDenormalised,
boolean hasPostFilter,
Transaction transaction) |
DataAccessMappingFeatureIterator(AppSchemaDataAccess store,
FeatureTypeMapping mapping,
Query query,
Query unrolledQuery,
boolean removeQueryLimitIfDenormalised) |
DataAccessMappingFeatureIterator(AppSchemaDataAccess store,
FeatureTypeMapping mapping,
Query query,
Query unrolledQuery,
boolean removeQueryLimitIfDenormalised,
Transaction transaction) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkForeignIdValues(List<Object> foreignIdValues)
Only used for Joining, to make sure that rows with different foreign id's aren't interpreted
as one feature and merged.
|
protected boolean |
checkForeignIdValues(List<Object> foreignIdValues,
Feature next)
Only used for Joining, to make sure that rows with different foreign id's aren't interpreted
as one feature and merged.
|
protected void |
cleanEmptyElements(Feature target) |
protected void |
closeSourceFeatures() |
protected Feature |
computeNext() |
protected String |
extractIdForAttribute(Expression idExpression,
Object sourceInstance)
Based on the set of xpath expression/id extracting expression, finds the ID for the attribute
idExpression from the source complex attribute. |
protected String |
extractIdForFeature(Feature feature) |
List<Object> |
getForeignIdValues(Object source)
Only used for Joining, to make sure that rows with different foreign id's aren't interpreted
as one feature and merged.
|
List<Object> |
getIdValues(Object source)
Only used for Joining, to make sure that rows with different foreign id's aren't interpreted
as one feature and merged.
|
FeatureSource<? extends FeatureType,? extends Feature> |
getMappedSource()
For testing purposes.
|
protected String |
getNextFeatureId() |
protected FeatureIterator<? extends Feature> |
getSourceFeatureIterator() |
protected List<Feature> |
getSources(String id)
Get all source features of the provided id.
|
protected Object |
getValue(Expression expression,
Object sourceFeature) |
protected Object |
getValues(boolean isMultiValued,
Expression expression,
Object sourceFeatureInput) |
boolean |
hasNext()
Does another Feature exist in this Iteration.
|
protected void |
initialiseSourceFeatures(FeatureTypeMapping mapping,
Query query,
CoordinateReferenceSystem targetCRS) |
protected boolean |
isByReference(Map<Name,Expression> clientPropsMappings,
boolean isNested)
Checks if client property has xlink:ref in it, if the attribute is for chained features.
|
protected boolean |
isNextSourceFeatureNull() |
boolean |
isReprojectionCrsEqual(CoordinateReferenceSystem source,
CoordinateReferenceSystem target) |
protected boolean |
isSourceFeatureIteratorNull() |
boolean |
isTransactionOwner() |
Object |
peekNextValue(Expression prop) |
protected Object |
peekValue(Object source,
Expression prop) |
protected Feature |
populateFeatureData(String id) |
protected Attribute |
setAttributeValue(Attribute target,
String id,
Object source,
AttributeMapping attMapping,
Object values,
XPathUtil.StepList inputXpath,
List<PropertyName> selectedProperties)
Sets the values of grouping attributes.
|
void |
setForeignIds(List<Expression> ids)
Only used for Joining, to make sure that rows with different foreign id's aren't interpreted
as one feature and merged.
|
void |
setListFilter(Filter filter) |
protected List<Feature> |
setNextFeature(String fId,
List<Object> foreignIdValues) |
protected void |
setXlinkReference(Attribute target,
Map<Name,Expression> clientPropsMappings,
Object value,
XPathUtil.StepList xpath,
AttributeType targetNodeType)
Set xlink:href client property for multi-valued chained features.
|
List<Feature> |
skip() |
void |
skipNestedMapping(AttributeMapping attMapping,
List<Feature> sources) |
protected boolean |
skipTopElement(Name topElement,
AttributeMapping attMapping,
AttributeType type) |
protected boolean |
sourceFeatureIteratorHasNext() |
protected boolean |
unprocessedFeatureExists() |
close, getClientProperties, getTransaction, getUnrolledQuery, isHasNextCalled, next, referenceToIdentifier, remove, setAttributeContent, setClientProperties, setGeometryUserData, setHasNextCalled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected CoordinateReferenceSystem reprojection
protected Feature curSrcFeature
protected FeatureSource<? extends FeatureType,? extends Feature> mappedSource
protected FeatureCollection<? extends FeatureType,? extends Feature> sourceFeatures
protected List<Expression> foreignIds
protected AttributeDescriptor targetFeature
public DataAccessMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, boolean isFiltered, boolean removeQueryLimitIfDenormalised) throws IOException
IOException
public DataAccessMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, boolean isFiltered, boolean removeQueryLimitIfDenormalised, boolean hasPostFilter) throws IOException
IOException
public DataAccessMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, boolean isFiltered, boolean removeQueryLimitIfDenormalised, boolean hasPostFilter, Transaction transaction) throws IOException
IOException
public DataAccessMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query) throws IOException
IOException
public DataAccessMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean removeQueryLimitIfDenormalised) throws IOException
store
- mapping
- place holder for the target type, the surrogate FeatureSource and the mappings
between them.query
- the query over the target feature type, that is to be unpacked to its equivalent
over the surrogate feature type.IOException
public DataAccessMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, Query unrolledQuery, boolean removeQueryLimitIfDenormalised, Transaction transaction) throws IOException
IOException
public boolean isTransactionOwner()
public boolean hasNext()
FeatureIterator
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.)
hasNext
in interface Iterator<Feature>
hasNext
in interface FeatureIterator<Feature>
hasNext
in class AbstractMappingFeatureIterator
protected FeatureIterator<? extends Feature> getSourceFeatureIterator()
getSourceFeatureIterator
in class AbstractMappingFeatureIterator
protected boolean isSourceFeatureIteratorNull()
isSourceFeatureIteratorNull
in class AbstractMappingFeatureIterator
protected Object peekValue(Object source, Expression prop)
public Object peekNextValue(Expression prop)
public void setForeignIds(List<Expression> ids)
public List<Object> getForeignIdValues(Object source)
protected boolean checkForeignIdValues(List<Object> foreignIdValues, Feature next)
public List<Object> getIdValues(Object source)
public boolean checkForeignIdValues(List<Object> foreignIdValues)
protected void initialiseSourceFeatures(FeatureTypeMapping mapping, Query query, CoordinateReferenceSystem targetCRS) throws IOException
initialiseSourceFeatures
in class AbstractMappingFeatureIterator
IOException
protected boolean unprocessedFeatureExists()
unprocessedFeatureExists
in class AbstractMappingFeatureIterator
protected String extractIdForAttribute(Expression idExpression, Object sourceInstance)
AbstractMappingFeatureIterator
idExpression
from the source complex attribute.extractIdForAttribute
in class AbstractMappingFeatureIterator
idExpression
- the location path of the attribute to be created, for which to obtain the
id by evaluating the corresponding org.geotools.filter.Expression
from
sourceInstance
.sourceInstance
- a complex attribute which is the source of the mapping.attributeXPath
, or null
if there is no an id mapping for that attribute.protected boolean isNextSourceFeatureNull()
isNextSourceFeatureNull
in class AbstractMappingFeatureIterator
protected boolean sourceFeatureIteratorHasNext()
sourceFeatureIteratorHasNext
in class AbstractMappingFeatureIterator
protected Object getValues(boolean isMultiValued, Expression expression, Object sourceFeatureInput)
protected Attribute setAttributeValue(Attribute target, String id, Object source, AttributeMapping attMapping, Object values, XPathUtil.StepList inputXpath, List<PropertyName> selectedProperties) throws IOException
target
- source
- attMapping
- values
- IOException
protected void setXlinkReference(Attribute target, Map<Name,Expression> clientPropsMappings, Object value, XPathUtil.StepList xpath, AttributeType targetNodeType)
target
- The target attributeclientPropsMappings
- Client properties mappingsvalue
- Nested featuresxpath
- Attribute xPath where the client properties are to be settargetNodeType
- Target node typeattMapping
- list
- IOException
protected List<Feature> setNextFeature(String fId, List<Object> foreignIdValues) throws IOException
IOException
public void skipNestedMapping(AttributeMapping attMapping, List<Feature> sources) throws IOException
IOException
public List<Feature> skip() throws IOException
IOException
protected Feature computeNext() throws IOException
computeNext
in class AbstractMappingFeatureIterator
IOException
protected List<Feature> getSources(String id) throws IOException
id
- The feature idIOException
protected String getNextFeatureId()
protected void cleanEmptyElements(Feature target) throws DataSourceException
DataSourceException
protected boolean skipTopElement(Name topElement, AttributeMapping attMapping, AttributeType type)
protected Feature populateFeatureData(String id) throws IOException
populateFeatureData
in class AbstractMappingFeatureIterator
IOException
protected void closeSourceFeatures()
closeSourceFeatures
in class AbstractMappingFeatureIterator
protected Object getValue(Expression expression, Object sourceFeature)
getValue
in class AbstractMappingFeatureIterator
protected boolean isByReference(Map<Name,Expression> clientPropsMappings, boolean isNested)
clientPropsMappings
- the client properties mappingsisNested
- true if we're dealing with chained/nested featurespublic boolean isReprojectionCrsEqual(CoordinateReferenceSystem source, CoordinateReferenceSystem target)
public void setListFilter(Filter filter)
public FeatureSource<? extends FeatureType,? extends Feature> getMappedSource()
Copyright © 1996–2019 Geotools. All rights reserved.