Package org.geotools.data.complex
Class XmlMappingFeatureIterator
- Object
-
- AbstractMappingFeatureIterator
-
- DataAccessMappingFeatureIterator
-
- XmlMappingFeatureIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<Feature>
,IMappingFeatureIterator
,FeatureIterator<Feature>
public class XmlMappingFeatureIterator extends DataAccessMappingFeatureIterator
An implementation of AbstractMappingFeatureIterator to handle XML datasources.- Author:
- Russell Petty (GeoScience Victoria), Rini Angreani (CSIRO Earth Science and Resource Engineering)
-
-
Field Summary
Fields Modifier and Type Field Description protected XmlResponse
xmlResponse
static String
XPATH_SEPARATOR
Constants for manipulating XPath Expressions-
Fields 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
Constructors Constructor Description XmlMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query)
XmlMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query, String xpath, String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeSourceFeatures()
protected Feature
computeNext()
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>
getSourceFeatureIterator()
protected List<String>
getValue(String expressionValue)
boolean
hasNext()
Return true if there are more features.protected boolean
isNextSourceFeatureNull()
protected boolean
isSourceFeatureIteratorNull()
protected Feature
populateFeatureData()
protected void
setClientProperties(Attribute target, Object xpathPrefix, Map<Name,Expression> clientProperties)
protected boolean
sourceFeatureIteratorHasNext()
protected boolean
unprocessedFeatureExists()
-
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 Detail
-
XPATH_SEPARATOR
public static final String XPATH_SEPARATOR
Constants for manipulating XPath Expressions- See Also:
- Constant Field Values
-
xmlResponse
protected XmlResponse xmlResponse
-
-
Constructor Detail
-
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 Detail
-
getSourceFeatureIterator
protected FeatureIterator<? extends Feature> getSourceFeatureIterator()
- Overrides:
getSourceFeatureIterator
in classDataAccessMappingFeatureIterator
-
isSourceFeatureIteratorNull
protected boolean isSourceFeatureIteratorNull()
- Overrides:
isSourceFeatureIteratorNull
in classDataAccessMappingFeatureIterator
-
extractIdForAttribute
protected String extractIdForAttribute(Expression idExpression, Object sourceInstance)
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
protected Feature populateFeatureData() throws IOException
- 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
-
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:
Iterator.hasNext()
-
computeNext
protected Feature computeNext() throws IOException
- Overrides:
computeNext
in classDataAccessMappingFeatureIterator
- Throws:
IOException
-
-