Class ALcyDataSourceHandler

java.lang.Object
com.luciad.lucy.model.ALcyDataSourceHandler
Direct Known Subclasses:
TLcyCompositeDataSourceHandler

public abstract class ALcyDataSourceHandler extends Object
Handler for any type of data source. This data source is represented as a string, it is up to subclasses to interpret this string as a file name, URI, ...

A handler is free what to do with the data source, for example it could interpret the data source as a file name, and open up a user interface panel that allows to select which part of the data source should be loaded on the map.

The difference with a ILcdModelDecoder is that a ALcyDataSourceHandler is more general: it is not restricted to producing an ILcdModel. The downside of being more general is that typically more work needs to be done in the implementation of a ALcyDataSourceHandler.

Consult the "Loading data in Lucy" chapter in the Lucy developer guide for more information about how this class can be used for data loading, and for some examples.

  • Constructor Details

    • ALcyDataSourceHandler

      protected ALcyDataSourceHandler()
      Creates a new ALcyDataSourceHandler.
  • Method Details

    • getDisplayName

      public abstract String getDisplayName()
      Returns the display name of this data source handler. This message will be displayed to a user, f.i. in a combo box if more than one handler can be used.
      Returns:
      The display name.
    • canHandleDataSource

      public abstract boolean canHandleDataSource(String aSourceName, Object aTarget)
      Checks whether the given data source can be handled by this handler. The aTarget parameter is a target object which this ALcyDataSourceHandler can use to handle the file. For example, in the File | Open action the object represents the ILcyMapComponent in which aSourceName can be opened.
      Parameters:
      aSourceName - The data source to test for validity.
      aTarget - An optional target param.
      Returns:
      True if the data source can be handled by this handler, false otherwise.
    • handleDataSource

      public abstract void handleDataSource(String aSourceName, Object aTarget) throws IOException
      Handles the given aSourceName. The aTarget parameter is a target object which this ALcyDataSourceHandler can use to handle the data source. For example, in the FileOpen action the object represents the ILcyMapComponent in which aSourceName can be opened.
      Parameters:
      aSourceName - The source name to handle. It is up to subclasses to interpret this string as a file, uri, ...
      aTarget - An optional target param.
      Throws:
      IOException - In case of IO failure.