org.geotools.data.complex
Class XmlMappingFeatureIterator

java.lang.Object
  extended by org.geotools.data.complex.AbstractMappingFeatureIterator
      extended by org.geotools.data.complex.XmlMappingFeatureIterator
All Implemented Interfaces:
java.util.Iterator<org.opengis.feature.Feature>, IMappingFeatureIterator, FeatureIterator<org.opengis.feature.Feature>

public class XmlMappingFeatureIterator
extends AbstractMappingFeatureIterator

An implementation of AbstractMappingFeatureIterator to handle XML datasources.

Version:
$Id: XmlMappingFeatureIterator.java 35958 2010-07-28 08:20:20Z victortey $
Author:
Russell Petty, GSV

Field Summary
protected static XmlResponse cachedXmlResponse
           
protected  XmlResponse xmlResponse
           
 
Fields inherited from class org.geotools.data.complex.AbstractMappingFeatureIterator
attf, featureCounter, featureFidMapping, LOGGER, mapping, maxFeatures, namespaceAwareFilterFactory, namespaces, store, XLINK_HREF_NAME, xpathAttributeBuilder
 
Constructor Summary
XmlMappingFeatureIterator(AppSchemaDataAccess store, FeatureTypeMapping mapping, Query query)
           
 
Method Summary
protected  void closeSourceFeatures()
           
protected  java.lang.String extractIdForAttribute(org.opengis.filter.expression.Expression idExpression, java.lang.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  java.lang.String extractIdForFeature()
           
protected  java.util.Iterator<org.opengis.feature.Feature> getSourceFeatureIterator()
           
protected  java.util.List<java.lang.String> getValue(org.opengis.filter.expression.Expression expression, java.lang.Object data)
           
protected  java.util.List<java.lang.String> getValue(java.lang.String expressionValue)
           
protected  java.util.List<java.lang.String> getValue(java.lang.String xpathPrefix, org.opengis.filter.expression.Expression node, java.lang.StringBuffer usedXpath)
           
protected  void initialiseSourceFeatures(FeatureTypeMapping mapping, Query query)
           
protected  boolean isNextSourceFeatureNull()
           
protected  boolean isSourceFeatureIteratorNull()
           
protected  org.opengis.feature.Feature populateFeatureData(java.lang.String id)
           
protected  void setAttributeValue(org.opengis.feature.Feature target, org.opengis.feature.Feature source, XPath.StepList xpath, java.lang.String id)
           
protected  void setAttributeValue(org.opengis.feature.Feature target, java.lang.Object source, AttributeMapping attMapping)
          Sets the values of grouping attributes.
protected  void setAttributeValueFromSources(org.opengis.feature.Feature target, AttributeMapping attMapping)
           
protected  void setClientProperties(org.opengis.feature.Attribute target, java.lang.Object source, java.util.Map<org.opengis.feature.type.Name,org.opengis.filter.expression.Expression> clientProperties)
           
protected  void setSourceFeatureIterator(java.util.Iterator<org.jdom.Element> xmlSourceFeatureIterator)
           
protected  boolean sourceFeatureIteratorHasNext()
           
protected  boolean unprocessedFeatureExists()
           
 
Methods inherited from class org.geotools.data.complex.AbstractMappingFeatureIterator
close, computeNext, getUnrolledQuery, hasNext, isHasNextCalled, next, remove, setGeometry, setHasNextCalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlResponse

protected XmlResponse xmlResponse

cachedXmlResponse

protected static XmlResponse cachedXmlResponse
Constructor Detail

XmlMappingFeatureIterator

public XmlMappingFeatureIterator(AppSchemaDataAccess store,
                                 FeatureTypeMapping mapping,
                                 Query query)
                          throws java.io.IOException
Parameters:
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.
Throws:
java.io.IOException
Method Detail

getSourceFeatureIterator

protected java.util.Iterator<org.opengis.feature.Feature> getSourceFeatureIterator()
Specified by:
getSourceFeatureIterator in class AbstractMappingFeatureIterator

isSourceFeatureIteratorNull

protected boolean isSourceFeatureIteratorNull()
Specified by:
isSourceFeatureIteratorNull in class AbstractMappingFeatureIterator

setSourceFeatureIterator

protected void setSourceFeatureIterator(java.util.Iterator<org.jdom.Element> xmlSourceFeatureIterator)

initialiseSourceFeatures

protected void initialiseSourceFeatures(FeatureTypeMapping mapping,
                                        Query query)
                                 throws java.io.IOException
Specified by:
initialiseSourceFeatures in class AbstractMappingFeatureIterator
Throws:
java.io.IOException

extractIdForFeature

protected java.lang.String extractIdForFeature()
Specified by:
extractIdForFeature in class AbstractMappingFeatureIterator

extractIdForAttribute

protected java.lang.String extractIdForAttribute(org.opengis.filter.expression.Expression idExpression,
                                                 java.lang.Object sourceInstance)
Description copied from class: AbstractMappingFeatureIterator
Based on the set of xpath expression/id extracting expression, finds the ID for the attribute idExpression from the source complex attribute.

Specified by:
extractIdForAttribute in class AbstractMappingFeatureIterator
Parameters:
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.
Returns:
the ID to be applied to a new attribute instance addressed by attributeXPath, or null if there is no an id mapping for that attribute.

populateFeatureData

protected org.opengis.feature.Feature populateFeatureData(java.lang.String id)
                                                   throws java.io.IOException
Specified by:
populateFeatureData in class AbstractMappingFeatureIterator
Throws:
java.io.IOException

unprocessedFeatureExists

protected boolean unprocessedFeatureExists()
Specified by:
unprocessedFeatureExists in class AbstractMappingFeatureIterator

sourceFeatureIteratorHasNext

protected boolean sourceFeatureIteratorHasNext()
Specified by:
sourceFeatureIteratorHasNext in class AbstractMappingFeatureIterator

isNextSourceFeatureNull

protected boolean isNextSourceFeatureNull()
Specified by:
isNextSourceFeatureNull in class AbstractMappingFeatureIterator

getValue

protected java.util.List<java.lang.String> getValue(org.opengis.filter.expression.Expression expression,
                                                    java.lang.Object data)
Specified by:
getValue in class AbstractMappingFeatureIterator

getValue

protected java.util.List<java.lang.String> getValue(java.lang.String xpathPrefix,
                                                    org.opengis.filter.expression.Expression node,
                                                    java.lang.StringBuffer usedXpath)

getValue

protected java.util.List<java.lang.String> getValue(java.lang.String expressionValue)

setAttributeValueFromSources

protected void setAttributeValueFromSources(org.opengis.feature.Feature target,
                                            AttributeMapping attMapping)
                                     throws java.io.IOException
Throws:
java.io.IOException

closeSourceFeatures

protected void closeSourceFeatures()
Specified by:
closeSourceFeatures in class AbstractMappingFeatureIterator

setAttributeValue

protected void setAttributeValue(org.opengis.feature.Feature target,
                                 org.opengis.feature.Feature source,
                                 XPath.StepList xpath,
                                 java.lang.String id)
                          throws java.io.IOException
Throws:
java.io.IOException

setAttributeValue

protected void setAttributeValue(org.opengis.feature.Feature target,
                                 java.lang.Object source,
                                 AttributeMapping attMapping)
                          throws java.io.IOException
Sets the values of grouping attributes.

Parameters:
sourceFeature -
groupingMappings -
targetFeature -
Throws:
java.io.IOException

setClientProperties

protected void setClientProperties(org.opengis.feature.Attribute target,
                                   java.lang.Object source,
                                   java.util.Map<org.opengis.feature.type.Name,org.opengis.filter.expression.Expression> clientProperties)
Specified by:
setClientProperties in class AbstractMappingFeatureIterator


Copyright © 1996-2010 Geotools. All Rights Reserved.