Interface ILcdAIXMHandler

All Known Implementing Classes:
TLcdAIXMAerodromeHandler, TLcdAIXMAirspaceHandler, TLcdAIXMDesignatedPointHandler, TLcdAIXMDMEHandler, TLcdAIXMGeoborderHandler, TLcdAIXMILSHandler, TLcdAIXMMarkerHandler, TLcdAIXMNDBHandler, TLcdAIXMObstacleHandler, TLcdAIXMProcedureHandler, TLcdAIXMRouteHandler, TLcdAIXMRunwayHandler, TLcdAIXMTACANHandler, TLcdAIXMVORHandler

public interface ILcdAIXMHandler
General interface for handling AIXM documents. An 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 newModel method or the setModelToUpdate method,
  • call the startDocument method,
  • present each beginning of an element found in the data source to the handler by calling the startElement method,
  • present each beginning of an element found in the data source to the handler by calling the endElement method,
  • call the endDocument method,
  • call the getModel method or the updateModel method 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 Details

    • getElementsToBeHandled

      String[] getElementsToBeHandled()
      Returns the elements for which the methods startElement and endElement should be invoked.

      These elements must be a direct child of one of the following AIXM elements:

      • AIXM-Snapshot
      • Changed
      • New
      • Withdrawn
      See the AIXM XML Schema documents for a list of possible childs.
      Returns:
      A String array containing the elements for which the methods startElement and endElement should be invoked.
    • startDocument

      void startDocument()
      Receive notification of the beginning of an AIXM document.
      See Also:
    • startElement

      void startElement(String aElementName, ILcdAssocSet aAttributes, Stack aElementStack)
      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 endElement event 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()
      An UnsupportedOperationException will 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

      void endElement(String aElementName, String aContent, Stack aElementStack)
      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 startElement event 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

      void newModel(String aSource, ILcdAIXMErrorMessageSupport aErrorMessage)
      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 handled
      aErrorMessage - 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 handled
      aModel - the model that must be updated
      aErrorMessage - 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

    • 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 newModel method to reset the internal state before he or she starts the decoding process,
      • the startDocument method before the first call of the startElement method,
      • the startElement method each time the beginning of an element in the data source is found,
      • the endElement method each time the end of an element in the data source is found,
      • the endDocument method after the last call of the endElement method.
      Returns:
      the model build by this handler
    • setDomainFactory

      @Deprecated void setDomainFactory(ALcdAISObjectFactory aDomainFactory)
      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 ALcdAISObjectFactory 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

      void setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
      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

      void setInitialBounds(ILcdBounds aInitialBounds)
      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

      void setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
      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

      void setAIXMModelFilter(ILcdAIXMModelFilter aFilter)
      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 - an ILcdAIXMModelFilter to filter the model objects