public class TLcdAIXM51XPathFactory extends TLcdXMLXPathFactory
A factory for XPath
objects that are applicable to AIXM 5.1
domain objects like TLcdAIXM51AbstractAIXMFeature
and
TLcdAIXM51AbstractAIXMTimeslice
.
XPath requires namespaces to be used in the expressions. The namespaces that
can be used in expressions for this factory are listed below. XPath
expressions containing elements that belong to other namespaces, or that do
not use the correct prefixes as specified below, will not work. If you want
to support other namespaces, it is possible to construct your own
XPathExpression
using the standard Java API.
The following namespaces can be used:
This factory also provides the following custom functions:
getLinkedObject
, but it returns a timeslice of the linked
feature instead of the feature itself. It uses the time slice provider that
is passed in the constructor to retrieve the time slice, or the default time
slice provider of the feature in case a time slice provider is not set on
this XPath factory.
Examples of XPath expressions for referencing properties in an AIXM 5.1 feature object:
/aixm51:AirportHeliport/aixm51:timeSlice/aixm51:AirportHeliportTimeSlice/aixm51:name
/aixm51:Runway/aixm51:timeSlice/aixm51:RunwayTimeSlice/aixm51:surfaceProperties/aixm51:SurfaceCharacteristics/aixm51:composition
/aixm51:Runway/aixm51:timeSlice/aixm51:RunwayTimeSlice/aixm51:length/@uom
/aixm51:Navaid/aixm51:timeSlice/aixm51:NavaidTimeSlice/aixm51:operationalStatus
/aixm51:TaxiwayElement/gml:identifier
These examples use absolute location paths to refer to a property, starting from the feature element itself. XPath also supports the use of abbreviated relative location paths, to reduce the number of steps in the expression. For example, the example expression to reference the name of an AirportHeliport could be rewritten in the following ways:
//aixm51:timeSlice/aixm51:AirportHeliportTimeSlice/aixm51:name
//aixm51:AirportHeliportTimeSlice/aixm51:name
//aixm51:name
If multiple nodes correspond to an XPath expression, the first occurrence is selected. By using a predicate, a number can be specified to indicate which node is to be selected. For example, if a Navaid has two timeslices, the following expression can be used to reference the interpretation of the second timeslice:
/aixm51:Navaid/aixm51:timeSlice[2]/aixm51:NavaidTimeSlice/aixm51:interpretation
XPath
,
XPathExpression
DEFAULT_OBJECT_MODEL_URI, DEFAULT_PROPERTY_NAME
Constructor and Description |
---|
TLcdAIXM51XPathFactory()
Creates a new
TLcdAIXM51XPathFactory . |
TLcdAIXM51XPathFactory(ILcdAIXM51TimeSliceProvider aTimeSliceProvider)
Creates a new
TLcdAIXM51XPathFactory . |
Modifier and Type | Method and Description |
---|---|
boolean |
getFeature(String aName) |
XPath |
newXPath() |
void |
setFeature(String aName,
boolean aValue) |
getXPathFunctionResolver, getXPathVariableResolver, isObjectModelSupported, setXPathFunctionResolver, setXPathVariableResolver
newInstance, newInstance, newInstance
public TLcdAIXM51XPathFactory()
TLcdAIXM51XPathFactory
.public TLcdAIXM51XPathFactory(ILcdAIXM51TimeSliceProvider aTimeSliceProvider)
TLcdAIXM51XPathFactory
.aTimeSliceProvider
- The time slice provider that will be used when retrieving time slices
of linked features. The default time slice provider of the AIXM 5.1 feature will be
used if this parameter is null.TLcdAIXM51Feature.getDefaultTimeSliceProvider()
public boolean getFeature(String aName) throws XPathFactoryConfigurationException
getFeature
in class TLcdXMLXPathFactory
XPathFactoryConfigurationException
public void setFeature(String aName, boolean aValue) throws XPathFactoryConfigurationException
setFeature
in class TLcdXMLXPathFactory
XPathFactoryConfigurationException
public XPath newXPath()
newXPath
in class TLcdXMLXPathFactory