Package org.geotools.data.complex
Class XmlFeatureTypeMapping
- Object
-
- FeatureTypeMapping
-
- XmlFeatureTypeMapping
-
public class XmlFeatureTypeMapping extends FeatureTypeMapping
- Author:
- Russell Petty (GeoScience Victoria), Rini Angreani (CSIRO Earth Science and Resource Engineering)
-
-
Constructor Summary
Constructors Constructor Description XmlFeatureTypeMapping()
No parameters constructor for use by the digester configuration engine as a JavaBeanXmlFeatureTypeMapping(FeatureSource<? extends FeatureType,? extends Feature> source, AttributeDescriptor target, List<AttributeMapping> mappings, NamespaceSupport namespaces, String itemXpath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Expression>
findMappingsFor(XPathUtil.StepList propertyName, boolean includeNestedMappings)
Looks up for attribute mappings matching the xpath expressionpropertyName
.AttributeMapping
getAttributeMappingByLabel(String label)
Finds an attribute mapping by label.List<AttributeMapping>
getAttributeMappingsByExpression(Expression sourceExpression)
Finds the attribute mappings for the given source expression.List<Expression>
getExpressionsIgnoreIndex(XPathUtil.StepList targetPath)
AttributeMapping
getStringMapping(XPathUtil.StepList exactPath)
Finds the attribute mapping for the target expressionexactPath
protected Expression
getValue(String xpathPrefix, Expression node, AttributeMapping mapping)
void
populateFeatureData()
-
Methods inherited from class FeatureTypeMapping
equals, getAttributeMapping, getAttributeMapping, getAttributeMappings, getAttributeMappingsIgnoreIndex, getDefaultGeometryXPath, getFeatureIdExpression, getIndexAttributeName, getIndexSource, getIsListMappings, getMappingName, getNamespaces, getNestedMappings, getSource, getSourceDatastoreId, getTargetFeature, getUnderlyingComplexMapping, hashCode, isDenormalised, isInclude, setDefaultGeometryXPath, setDenormalised, setInclude, setIndexSource, setName, setSource, setSourceDatastoreId, setTargetFeature
-
-
-
-
Field Detail
-
itemXpath
protected String itemXpath
-
-
Constructor Detail
-
XmlFeatureTypeMapping
public XmlFeatureTypeMapping()
No parameters constructor for use by the digester configuration engine as a JavaBean
-
XmlFeatureTypeMapping
public XmlFeatureTypeMapping(FeatureSource<? extends FeatureType,? extends Feature> source, AttributeDescriptor target, List<AttributeMapping> mappings, NamespaceSupport namespaces, String itemXpath)
-
-
Method Detail
-
getExpressionsIgnoreIndex
public List<Expression> getExpressionsIgnoreIndex(XPathUtil.StepList targetPath)
-
getAttributeMappingsByExpression
public List<AttributeMapping> getAttributeMappingsByExpression(Expression sourceExpression)
Finds the attribute mappings for the given source expression.- Overrides:
getAttributeMappingsByExpression
in classFeatureTypeMapping
- Returns:
- list of matching attribute mappings
-
getAttributeMappingByLabel
public AttributeMapping getAttributeMappingByLabel(String label)
Finds an attribute mapping by label.- Parameters:
label
- The attribute mapping label.- Returns:
- Attribute mapping that matches the label, or null.
-
getStringMapping
public AttributeMapping getStringMapping(XPathUtil.StepList exactPath)
Finds the attribute mapping for the target expressionexactPath
- Parameters:
exactPath
- the xpath expression on the target schema to find the mapping for- Returns:
- the attribute mapping that match 1:1 with
exactPath
ornull
if
-
populateFeatureData
public void populateFeatureData() throws IOException
- Throws:
IOException
-
getValue
protected Expression getValue(String xpathPrefix, Expression node, AttributeMapping mapping)
-
findMappingsFor
public List<Expression> findMappingsFor(XPathUtil.StepList propertyName, boolean includeNestedMappings)
Looks up for attribute mappings matching the xpath expressionpropertyName
.If any step in
propertyName
has index greater than 1, any mapping for the same property applies, regardless of the mapping. For example, if there are mappings forgml:name[1]
,gml:name[2]
andgml:name[3]
, but propertyName is justgml:name
, all three mappings apply.- Overrides:
findMappingsFor
in classFeatureTypeMapping
-
-