Package org.geotools.data.complex
Class XmlMappingFeatureIterator
Object
AbstractMappingFeatureIterator
DataAccessMappingFeatureIterator
XmlMappingFeatureIterator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<Feature>
,IMappingFeatureIterator
,FeatureIterator<Feature>
An implementation of AbstractMappingFeatureIterator to handle XML datasources.
- Author:
- Russell Petty (GeoScience Victoria), Rini Angreani (CSIRO Earth Science and Resource Engineering)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected XmlResponse
static final String
Constants for manipulating XPath ExpressionsFields inherited from class DataAccessMappingFeatureIterator
curSrcFeature, foreignIds, mappedSource, reprojection, sourceFeatures, targetFeature
Fields inherited from class AbstractMappingFeatureIterator
attf, dataMaxFeatures, featureCounter, filterFac, ftf, GEOMETRY_FACTORY, includeMandatory, LOGGER, mapping, MULTI_VALUE_TYPE, namespaceAwareFilterFactory, namespaces, query, requestMaxFeatures, RESOLVE_TIMEOUT_POLL_INTERVAL, resolveDepth, resolveTimeOut, selectedMapping, selectedProperties, store, transaction, UNBOUNDED_MULTI_VALUE, XLINK_HREF_NAME, xpathAttributeBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionXmlMappingFeatureIterator
(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query) XmlMappingFeatureIterator
(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, String xpath, String value) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected Feature
static String
createIndexedItemXpathString
(XmlFeatureTypeMapping mapping, XmlResponse xmlResponse, int indexCounter) protected 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 FeatureIterator<? extends Feature>
boolean
hasNext()
Return true if there are more features.protected boolean
protected boolean
protected Feature
protected void
setClientProperties
(Attribute target, Object xpathPrefix, Map<Name, Expression> clientProperties) protected boolean
protected boolean
Methods inherited from class DataAccessMappingFeatureIterator
checkForeignIdValues, checkForeignIdValues, cleanEmptyElements, extractIdForFeature, getForeignIdValues, getIdValues, getMappedSource, getNextFeatureId, getSources, getValue, getValues, initialiseSourceFeatures, isByReference, isReprojectionCrsEqual, isTransactionOwner, peekNextValue, peekValue, populateFeatureData, setAttributeValue, setForeignIds, setListFilter, setNextFeature, setXlinkReference, skip, skipNestedMapping, skipTopElement
Methods inherited from class AbstractMappingFeatureIterator
close, getClientProperties, getTransaction, getUnrolledQuery, isHasNextCalled, next, referenceToIdentifier, remove, setAttributeContent, setGeometryUserData, setHasNextCalled
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface Iterator
forEachRemaining
-
Field Details
-
XPATH_SEPARATOR
Constants for manipulating XPath Expressions- See Also:
-
xmlResponse
-
-
Constructor Details
-
XmlMappingFeatureIterator
public XmlMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query) throws IOException - Parameters:
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.- Throws:
IOException
-
XmlMappingFeatureIterator
public XmlMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, String xpath, String value) throws IOException - Throws:
IOException
-
-
Method Details
-
getSourceFeatureIterator
- Overrides:
getSourceFeatureIterator
in classDataAccessMappingFeatureIterator
-
isSourceFeatureIteratorNull
protected boolean isSourceFeatureIteratorNull()- Overrides:
isSourceFeatureIteratorNull
in classDataAccessMappingFeatureIterator
-
extractIdForAttribute
Description copied from class:AbstractMappingFeatureIterator
Based on the set of xpath expression/id extracting expression, finds the ID for the attributeidExpression
from the source complex attribute.- Overrides:
extractIdForAttribute
in classDataAccessMappingFeatureIterator
- 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.
-
createIndexedItemXpathString
public static String createIndexedItemXpathString(XmlFeatureTypeMapping mapping, XmlResponse xmlResponse, int indexCounter) -
populateFeatureData
- Throws:
IOException
-
setClientProperties
protected void setClientProperties(Attribute target, Object xpathPrefix, Map<Name, Expression> clientProperties) - Overrides:
setClientProperties
in classAbstractMappingFeatureIterator
-
unprocessedFeatureExists
protected boolean unprocessedFeatureExists()- Overrides:
unprocessedFeatureExists
in classDataAccessMappingFeatureIterator
-
sourceFeatureIteratorHasNext
protected boolean sourceFeatureIteratorHasNext()- Overrides:
sourceFeatureIteratorHasNext
in classDataAccessMappingFeatureIterator
-
isNextSourceFeatureNull
protected boolean isNextSourceFeatureNull()- Overrides:
isNextSourceFeatureNull
in classDataAccessMappingFeatureIterator
-
getValue
-
closeSourceFeatures
protected void closeSourceFeatures()- Overrides:
closeSourceFeatures
in classDataAccessMappingFeatureIterator
-
hasNext
public boolean hasNext()Return true if there are more features.- Specified by:
hasNext
in interfaceFeatureIterator<Feature>
- Specified by:
hasNext
in interfaceIterator<Feature>
- Overrides:
hasNext
in classDataAccessMappingFeatureIterator
- Returns:
- true if more Features exist, false otherwise.
- See Also:
-
computeNext
- Overrides:
computeNext
in classDataAccessMappingFeatureIterator
- Throws:
IOException
-