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 XmlResponsexmlResponsestatic StringXPATH_SEPARATORConstants 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 voidcloseSourceFeatures()protected FeaturecomputeNext()static StringcreateIndexedItemXpathString(XmlFeatureTypeMapping mapping, XmlResponse xmlResponse, int indexCounter)protected StringextractIdForAttribute(Expression idExpression, Object sourceInstance)Based on the set of xpath expression/id extracting expression, finds the ID for the attributeidExpressionfrom the source complex attribute.protected FeatureIterator<? extends Feature>getSourceFeatureIterator()protected List<String>getValue(String expressionValue)booleanhasNext()Return true if there are more features.protected booleanisNextSourceFeatureNull()protected booleanisSourceFeatureIteratorNull()protected FeaturepopulateFeatureData()protected voidsetClientProperties(Attribute target, Object xpathPrefix, Map<Name,Expression> clientProperties)protected booleansourceFeatureIteratorHasNext()protected booleanunprocessedFeatureExists()-
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:
getSourceFeatureIteratorin classDataAccessMappingFeatureIterator
-
isSourceFeatureIteratorNull
protected boolean isSourceFeatureIteratorNull()
- Overrides:
isSourceFeatureIteratorNullin classDataAccessMappingFeatureIterator
-
extractIdForAttribute
protected String extractIdForAttribute(Expression idExpression, Object sourceInstance)
Description copied from class:AbstractMappingFeatureIteratorBased on the set of xpath expression/id extracting expression, finds the ID for the attributeidExpressionfrom the source complex attribute.- Overrides:
extractIdForAttributein classDataAccessMappingFeatureIterator- Parameters:
idExpression- the location path of the attribute to be created, for which to obtain the id by evaluating the correspondingorg.geotools.filter.ExpressionfromsourceInstance.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, ornullif 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:
setClientPropertiesin classAbstractMappingFeatureIterator
-
unprocessedFeatureExists
protected boolean unprocessedFeatureExists()
- Overrides:
unprocessedFeatureExistsin classDataAccessMappingFeatureIterator
-
sourceFeatureIteratorHasNext
protected boolean sourceFeatureIteratorHasNext()
- Overrides:
sourceFeatureIteratorHasNextin classDataAccessMappingFeatureIterator
-
isNextSourceFeatureNull
protected boolean isNextSourceFeatureNull()
- Overrides:
isNextSourceFeatureNullin classDataAccessMappingFeatureIterator
-
closeSourceFeatures
protected void closeSourceFeatures()
- Overrides:
closeSourceFeaturesin classDataAccessMappingFeatureIterator
-
hasNext
public boolean hasNext()
Return true if there are more features.- Specified by:
hasNextin interfaceFeatureIterator<Feature>- Specified by:
hasNextin interfaceIterator<Feature>- Overrides:
hasNextin classDataAccessMappingFeatureIterator- Returns:
- true if more Features exist, false otherwise.
- See Also:
Iterator.hasNext()
-
computeNext
protected Feature computeNext() throws IOException
- Overrides:
computeNextin classDataAccessMappingFeatureIterator- Throws:
IOException
-
-