Interface ILcdAIXMHandler
- All Known Implementing Classes:
TLcdAIXMAerodromeHandler,TLcdAIXMAirspaceHandler,TLcdAIXMDesignatedPointHandler,TLcdAIXMDMEHandler,TLcdAIXMGeoborderHandler,TLcdAIXMILSHandler,TLcdAIXMMarkerHandler,TLcdAIXMNDBHandler,TLcdAIXMObstacleHandler,TLcdAIXMProcedureHandler,TLcdAIXMRouteHandler,TLcdAIXMRunwayHandler,TLcdAIXMTACANHandler,TLcdAIXMVORHandler
ILcdAIXMHandler expects AIXM data element per element.
It will decode only the records it can handle and create an ILcdModel
with the decoded objects.
In order to use a handler to create a model, a user should
- first reset the internal state of the handler by calling the
newModelmethod or thesetModelToUpdatemethod, - call the
startDocumentmethod, - present each beginning of an element found in the data source to the handler by
calling the
startElementmethod, - present each beginning of an element found in the data source to the handler by
calling the
endElementmethod, - call the
endDocumentmethod, - call the
getModelmethod or theupdateModelmethod to respectively obtain the model or update a registered model.
Optionally, the user can specify
- the factory to be used to create the domain objects,
- an initial bounds for the model being created,
- a bounds to filter the objects before they are stored in the model; only objects whose bounds interact with the given bounds will be retained.
-
Method Summary
Modifier and TypeMethodDescriptionvoidReceive notification of the end of an AIXM document.voidendElement(String aElementName, String aContent, Stack aElementStack) Receive notification of the end of an AIXM element.Returns the bounds that will be used as a filter on the model created by this handler.Returns the factory to be used to create domain objects.Deprecated.String[]Returns the elements for which the methodsstartElementandendElementshould be invoked.Returns the bounds to be used as initial bounds for the model created by this handler.getModel()Returns the model build by this handler.voidnewModel(String aSource, ILcdAIXMErrorMessageSupport aErrorMessage) Resets the internal state of this handler so that it is ready to handle a new data source from scratch.voidsetAIXMModelFilter(ILcdAIXMModelFilter aFilter) Specifies a filter to be used while creating the model.voidsetBoundsToFilterOn(ILcdBounds aBoundsToFilterOn) Specifies a bounds that will be used as a filter on the model created by this handler.voidsetDataObjectFactory(TLcdAISDataObjectFactory aFactory) Specifies the factory to be used to create domain objects.voidsetDomainFactory(ALcdAISObjectFactory aDomainFactory) Deprecated.voidsetInitialBounds(ILcdBounds aInitialBounds) Specifies a bounds to be used as initial bounds for the model created by this handler.booleansetModelToUpdate(String aSource, ILcdModel aModel, ILcdAIXMErrorMessageSupport aErrorMessage) Sets the internal state of this handler so that it is ready to update the given model with a new data source.voidReceive notification of the beginning of an AIXM document.voidstartElement(String aElementName, ILcdAssocSet aAttributes, Stack aElementStack) Receive notification of the beginning of an AIXM element.voidApplies the updates that are read to the model.
-
Method Details
-
getElementsToBeHandled
String[] getElementsToBeHandled()Returns the elements for which the methodsstartElementandendElementshould be invoked.These elements must be a direct child of one of the following AIXM elements:
- AIXM-Snapshot
- Changed
- New
- Withdrawn
- Returns:
- A
Stringarray containing the elements for which the methodsstartElementandendElementshould be invoked.
-
startDocument
void startDocument()Receive notification of the beginning of an AIXM document.- See Also:
-
startElement
Receive notification of the beginning of an AIXM element.This method will be invoked at the beginning of every element in the AIXM document; there will be a corresponding
endElementevent for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.The attributes attached to the element are available through an immutable
ILcdAssocSet. Only the following methods of the interface are available:- public int size()
- public boolean hasValue(Object aObject)
- public Object getValue(Object aKey)
- public Enumeration keys()
- public Enumeration elements()
UnsupportedOperationExceptionwill be thrown if one of the other methods are called.- Parameters:
aElementName- The name of the element.aAttributes- The attributes attached to the element.aElementStack- A stack containing the element names of all the parents of the current element and itself.- See Also:
-
endElement
Receive notification of the end of an AIXM element.This method will be invoked at the end of every element in the AIXM document; there will be a corresponding
startElementevent for every endElement event (even when the element is empty).- Parameters:
aElementName- The name of the element.aContent- The contents of the current element, or the empty string if the element was empty.aElementStack- A stack containing the element names of all the parents of the current element and itself.
-
endDocument
void endDocument()Receive notification of the end of an AIXM document.- See Also:
-
newModel
Resets the internal state of this handler so that it is ready to handle a new data source from scratch.The user should call this method before using this handler in a decoding process of an AIXM snapshot.
- Parameters:
aSource- the name of the source that will be handledaErrorMessage- for each irregular situation during the decoding, a report should be added to this object
-
setModelToUpdate
boolean setModelToUpdate(String aSource, ILcdModel aModel, ILcdAIXMErrorMessageSupport aErrorMessage) Sets the internal state of this handler so that it is ready to update the given model with a new data source.The user should call this method before using this handler in a decoding process of an AIXM update.
- Parameters:
aSource- the name of the source that will be handledaModel- the model that must be updatedaErrorMessage- for each irregular situation during the decoding, a report should be added to this object
-
updateModel
void updateModel()Applies the updates that are read to the model.Please remark that this handler is only capable of updating the model if the user calls
- the
setModelToUpdatemethod to set the model that has to be updated, - the
startDocumentmethod before the first call of thestartElementmethod, - the
startElementmethod each time the beginning of an element in the data source is found, - the
endElementmethod each time the end of an element in the data source is found, - the
endDocumentmethod after the last call of theendElementmethod.
- the
-
getModel
ILcdFeatureIndexedAnd2DBoundsIndexedModel getModel()Returns the model build by this handler.Please remark that this handler is only capable of creating the expected model if the user calls
- the
newModelmethod to reset the internal state before he or she starts the decoding process, - the
startDocumentmethod before the first call of thestartElementmethod, - the
startElementmethod each time the beginning of an element in the data source is found, - the
endElementmethod each time the end of an element in the data source is found, - the
endDocumentmethod after the last call of theendElementmethod.
- Returns:
- the model build by this handler
- the
-
setDomainFactory
Deprecated.Specifies the domainFactory to be used to create domain objects.The given domainFactory must not be null. Note that if a data object factory is set, the domain factory will not be used.
- Parameters:
aDomainFactory- the domainFactory to be used to create domain objects- See Also:
-
getDomainFactory
Deprecated.Returns the domainFactory to be used to create domain objects.- Returns:
- the domainFactory to be used to create domain objects
- See Also:
-
setDataObjectFactory
Specifies the factory to be used to create domain objects.The given factory must not be null.
- Parameters:
aFactory- the domainFactory to be used to create domain objects- See Also:
-
getDataObjectFactory
TLcdAISDataObjectFactory getDataObjectFactory()Returns the factory to be used to create domain objects.- Returns:
- the factory to be used to create domain objects
- See Also:
-
setInitialBounds
Specifies a bounds to be used as initial bounds for the model created by this handler.This bounds should be large enough to enclose (most of) the model objects. This option is used to avoid to many expansions of the model bounds.
This parameter may be null.
Note: This bounds is not a filter! If a model objects bounds does not interact with aInitialBounds, aInitialBounds will be enlarged to enclose the object.
- Parameters:
aInitialBounds- the initial bounds for the model created by this handler
-
getInitialBounds
ILcdBounds getInitialBounds()Returns the bounds to be used as initial bounds for the model created by this handler.- Returns:
- bounds to be used as initial bounds for the model created by this handler
- See Also:
-
setBoundsToFilterOn
Specifies a bounds that will be used as a filter on the model created by this handler.If this bounds is null, all objects found in the data source will be inserted into the model. If this bounds is not null, only the objects whose bounds interact with the specified bounds will be inserted into the model.
- Parameters:
aBoundsToFilterOn- the bounds to be used as a filter
-
getBoundsToFilterOn
ILcdBounds getBoundsToFilterOn()Returns the bounds that will be used as a filter on the model created by this handler.- Returns:
- the bounds that will be used as a filter on the model created by this handler
- See Also:
-
setAIXMModelFilter
Specifies a filter to be used while creating the model. Only model objects that pass through the filter will be in the resulting model.- Parameters:
aFilter- anILcdAIXMModelFilterto filter the model objects
-
getDataObjectFactory()