public class FeatureTypeMapping extends Object
Constructor and Description |
---|
FeatureTypeMapping()
No parameters constructor for use by the digester configuration engine as a JavaBean
|
FeatureTypeMapping(FeatureSource<? extends FeatureType,? extends Feature> source,
AttributeDescriptor target,
List<AttributeMapping> mappings,
NamespaceSupport namespaces) |
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,
FeatureSource<SimpleFeatureType,SimpleFeature> indexSource,
AttributeDescriptor target,
String defaultGeometryXPath,
List<AttributeMapping> mappings,
NamespaceSupport namespaces,
boolean isDenormalised) |
Modifier and Type | Method and Description |
---|---|
List<Expression> |
findMappingsFor(XPathUtil.StepList propertyName,
boolean includeNestedMappings)
Looks up for attribute mappings matching the xpath expression
propertyName . |
AttributeMapping |
getAttributeMapping(String xpathExpression)
Finds the attribute mapping for the target expression
exactPath . |
AttributeMapping |
getAttributeMapping(XPathUtil.StepList exactPath)
Finds the attribute mapping for the target expression
exactPath |
List<AttributeMapping> |
getAttributeMappings() |
List<AttributeMapping> |
getAttributeMappingsByExpression(Expression sourceExpression)
Finds the attribute mappings for the given source expression.
|
List<AttributeMapping> |
getAttributeMappingsIgnoreIndex(XPathUtil.StepList targetPath)
Finds the attribute mappings for the given target location path.
|
String |
getDefaultGeometryXPath()
Returns the default geometry XPath expression that was specified in the mapping
configuration, or
null if none was set. |
Expression |
getFeatureIdExpression() |
String |
getIndexAttributeName(String xpath)
Returns index attribute name linked to unrolled propertyName or null if is absent
|
FeatureSource<SimpleFeatureType,SimpleFeature> |
getIndexSource() |
List<AttributeMapping> |
getIsListMappings()
Return list of attribute mappings that are configured as list (isList = true).
|
Name |
getMappingName() |
NamespaceSupport |
getNamespaces() |
List<NestedAttributeMapping> |
getNestedMappings() |
FeatureSource<? extends FeatureType,? extends Feature> |
getSource() |
Optional<String> |
getSourceDatastoreId()
Returns the source datastore id from mappings configurations.
|
AttributeDescriptor |
getTargetFeature() |
FeatureTypeMapping |
getUnderlyingComplexMapping() |
boolean |
isDenormalised() |
void |
setDefaultGeometryXPath(String defaultGeometryXPath)
Specifies which property should be used as default geometry for the target feature type.
|
void |
setDenormalised(boolean isDenormalised) |
void |
setIndexSource(FeatureSource<SimpleFeatureType,SimpleFeature> indexSource) |
void |
setName(Name name) |
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) |
public FeatureTypeMapping()
public FeatureTypeMapping(FeatureSource<? extends FeatureType,? extends Feature> source, AttributeDescriptor target, List<AttributeMapping> mappings, NamespaceSupport namespaces)
public FeatureTypeMapping(FeatureSource<? extends FeatureType,? extends Feature> source, AttributeDescriptor target, String defaultGeometryXPath, List<AttributeMapping> mappings, NamespaceSupport namespaces, boolean isDenormalised)
public FeatureTypeMapping(FeatureSource<? extends FeatureType,? extends Feature> source, FeatureSource<SimpleFeatureType,SimpleFeature> indexSource, AttributeDescriptor target, String defaultGeometryXPath, List<AttributeMapping> mappings, NamespaceSupport namespaces, boolean isDenormalised)
public List<AttributeMapping> getAttributeMappings()
public List<NestedAttributeMapping> getNestedMappings()
public Expression getFeatureIdExpression()
public List<AttributeMapping> getAttributeMappingsIgnoreIndex(XPathUtil.StepList targetPath)
public List<AttributeMapping> getAttributeMappingsByExpression(Expression sourceExpression)
public AttributeMapping getAttributeMapping(XPathUtil.StepList exactPath)
exactPath
exactPath
- the xpath expression on the target schema to find the mapping forexactPath
or null
ifpublic AttributeMapping getAttributeMapping(String xpathExpression)
exactPath
.xpathExpression
- the xpath expression on the target schema to find the mapping forexactPath
or null
public NamespaceSupport getNamespaces()
public void setTargetFeature(AttributeDescriptor feature)
#setTargetType(FeatureType)
public AttributeDescriptor getTargetFeature()
public FeatureSource<? extends FeatureType,? extends Feature> getSource()
public FeatureTypeMapping getUnderlyingComplexMapping()
public void setName(Name name)
public Name getMappingName()
public List<AttributeMapping> getIsListMappings()
public List<Expression> findMappingsFor(XPathUtil.StepList propertyName, boolean includeNestedMappings)
propertyName
.
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 for
gml:name[1]
, gml:name[2]
and gml:name[3]
, but
propertyName is just gml:name
, all three mappings apply.
public boolean isDenormalised()
public void setDenormalised(boolean isDenormalised)
public String getDefaultGeometryXPath()
null
if none was set.setDefaultGeometryXPath(String)
public void setDefaultGeometryXPath(String defaultGeometryXPath)
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.
defaultGeometryXPath
- XPath expression identifying the default geometry propertypublic void setSource(FeatureSource<? extends FeatureType,? extends Feature> source)
public FeatureSource<SimpleFeatureType,SimpleFeature> getIndexSource()
public void setIndexSource(FeatureSource<SimpleFeatureType,SimpleFeature> indexSource)
public String getIndexAttributeName(String xpath)
public Optional<String> getSourceDatastoreId()
public void setSourceDatastoreId(String sourceDatastoreId)
Copyright © 1996–2023 Geotools. All rights reserved.