Package org.geotools.data.complex
Class FeatureTypeMapping
Object
FeatureTypeMapping
- Direct Known Subclasses:
XmlFeatureTypeMapping
- Since:
- 2.4
- Author:
- Gabriel Roldan (Axios Engineering), Rini Angreani (CSIRO Earth Science and Resource Engineering)
-
Constructor Summary
ConstructorsConstructorDescriptionNo parameters constructor for use by the digester configuration engine as a JavaBeanFeatureTypeMapping
(FeatureSource<? extends FeatureType, ? extends Feature> source, FeatureSource<SimpleFeatureType, SimpleFeature> indexSource, AttributeDescriptor target, String defaultGeometryXPath, List<AttributeMapping> mappings, NamespaceSupport namespaces, boolean isDenormalised) FeatureTypeMapping
(FeatureSource<? extends FeatureType, ? extends Feature> source, AttributeDescriptor target, String defaultGeometryXPath, List<AttributeMapping> mappings, NamespaceSupport namespaces, boolean isDenormalised) FeatureTypeMapping
(FeatureSource<? extends FeatureType, ? extends Feature> source, AttributeDescriptor target, List<AttributeMapping> mappings, NamespaceSupport namespaces) -
Method Summary
Modifier and TypeMethodDescriptionboolean
findMappingsFor
(XPathUtil.StepList propertyName, boolean includeNestedMappings) Looks up for attribute mappings matching the xpath expressionpropertyName
.getAttributeMapping
(String xpathExpression) Finds the attribute mapping for the target expressionexactPath
.getAttributeMapping
(XPathUtil.StepList exactPath) Finds the attribute mapping for the target expressionexactPath
getAttributeMappingsByExpression
(Expression sourceExpression) Finds the attribute mappings for the given source expression.getAttributeMappingsIgnoreIndex
(XPathUtil.StepList targetPath) Finds the attribute mappings for the given target location path.Returns the default geometry XPath expression that was specified in the mapping configuration, ornull
if none was set.getIndexAttributeName
(String xpath) Returns index attribute name linked to unrolled propertyName or null if is absentReturn list of attribute mappings that are configured as list (isList = true).FeatureSource<? extends FeatureType,
? extends Feature> Returns the source datastore id from mappings configurations.int
hashCode()
boolean
boolean
void
setDefaultGeometryXPath
(String defaultGeometryXPath) Specifies which property should be used as default geometry for the target feature type.void
setDenormalised
(boolean isDenormalised) void
setInclude
(boolean isInclude) void
setIndexSource
(FeatureSource<SimpleFeatureType, SimpleFeature> indexSource) void
void
setSource
(FeatureSource<? extends FeatureType, ? extends Feature> source) void
setSourceDatastoreId
(String sourceDatastoreId) Sets the source datastore id from mappings configurations.void
setTargetFeature
(AttributeDescriptor feature) Has to be called after#setTargetType(FeatureType)
-
Constructor Details
-
FeatureTypeMapping
public FeatureTypeMapping()No parameters constructor for use by the digester configuration engine as a JavaBean -
FeatureTypeMapping
public FeatureTypeMapping(FeatureSource<? extends FeatureType, ? extends Feature> source, AttributeDescriptor target, List<AttributeMapping> mappings, NamespaceSupport namespaces) -
FeatureTypeMapping
public FeatureTypeMapping(FeatureSource<? extends FeatureType, ? extends Feature> source, AttributeDescriptor target, String defaultGeometryXPath, List<AttributeMapping> mappings, NamespaceSupport namespaces, boolean isDenormalised) -
FeatureTypeMapping
public FeatureTypeMapping(FeatureSource<? extends FeatureType, ? extends Feature> source, FeatureSource<SimpleFeatureType, SimpleFeature> indexSource, AttributeDescriptor target, String defaultGeometryXPath, List<AttributeMapping> mappings, NamespaceSupport namespaces, boolean isDenormalised)
-
-
Method Details
-
getAttributeMappings
-
getNestedMappings
-
getFeatureIdExpression
-
getAttributeMappingsIgnoreIndex
Finds the attribute mappings for the given target location path. If the exactPath is not indexed, it will get all the matching mappings ignoring index. If it is indexed, it will get the one with matching index only. -
getAttributeMappingsByExpression
Finds the attribute mappings for the given source expression.- Returns:
- list of matching attribute mappings
-
getAttributeMapping
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
-
getAttributeMapping
Finds the attribute mapping for the target expressionexactPath
.- Parameters:
xpathExpression
- the xpath expression on the target schema to find the mapping for- Returns:
- the attribute mapping that match 1:1 with
exactPath
ornull
-
getNamespaces
-
setTargetFeature
Has to be called after#setTargetType(FeatureType)
-
getTargetFeature
-
getSource
-
getUnderlyingComplexMapping
-
setName
-
getMappingName
-
getIsListMappings
Return list of attribute mappings that are configured as list (isList = true).- Returns:
- attribute mappings with isList enabled.
-
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. -
equals
-
hashCode
public int hashCode() -
isDenormalised
public boolean isDenormalised() -
setDenormalised
public void setDenormalised(boolean isDenormalised) -
isInclude
public boolean isInclude() -
setInclude
public void setInclude(boolean isInclude) -
getDefaultGeometryXPath
Returns the default geometry XPath expression that was specified in the mapping configuration, ornull
if none was set.- Returns:
- XPath expression identifying the default geometry property
- See Also:
-
setDefaultGeometryXPath
Specifies which property should be used as default geometry for the target feature type.This is especially useful when automatic detection of the default geometry is difficult or impossible to do, e.g. when the geometry property is nested inside another property, or multiple geometry properties are present.
The specified geometry property may be a direct child of the target feature type, or may be nested inside another property. If the evaluation of the provided expression yields multiple values, an exception will be thrown at runtime.
- Parameters:
defaultGeometryXPath
- XPath expression identifying the default geometry property
-
setSource
-
getIndexSource
-
setIndexSource
-
getIndexAttributeName
Returns index attribute name linked to unrolled propertyName or null if is absent- Returns:
- Index attribute name
-
getSourceDatastoreId
Returns the source datastore id from mappings configurations. -
setSourceDatastoreId
Sets the source datastore id from mappings configurations.
-