Class NullDataSource

  • All Implemented Interfaces:
    DataSource

    public final class NullDataSource
    extends Object
    implements DataSource
    An empty implementation of the DataSource interface.
    • Constructor Detail

      • NullDataSource

        public NullDataSource()
    • Method Detail

      • getLocation

        @NotNull
        public String getLocation()
        Description copied from interface: DataSource
        Yields a string representation for the location of the data source (if applicable)
        Specified by:
        getLocation in interface DataSource
      • addListener

        public void addListener​(@NotNull
                                DataSourceListener listener)
        Description copied from interface: DataSource
        Registers listeners who need to be notified about changes in the underlying data source. It is the responsibility of the DataSource to detect such updates and notify the listeners.
        Specified by:
        addListener in interface DataSource
      • getTimestamp

        public long getTimestamp()
        Description copied from interface: DataSource
        Retrieves the last modification timestamp. The timestamp should reliably reflect all external changes to the data source.
        Specified by:
        getTimestamp in interface DataSource
        Returns:
        0 if timestamp is not supported for the source, or -1 if the source is dead (like when file is deleted)
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: DataSource
        TODO Makes sense only with API which introduce changes to the DataSource. Currently it is incomplete. Usually there is a possibility to edit DataSource. For examples please see StreamDataSource.
        Specified by:
        isReadOnly in interface DataSource
        Returns:
        whether this data source can be changed.
      • getType

        @NotNull
        public DataSourceType getType()
        Description copied from interface: DataSource
        Defines a data source type for this kind of data sources. The data source type notion is strongly associated with the possibility to provide DataSourceFactory and ModelFactory custom mappings. See DataSourceFactoryRuleService and ModelFactoryService for the implementation details.
        Specified by:
        getType in interface DataSource
        Returns:
        the unique data source type for this instance of data source if the developer wants others to be able to change the default behavior of this data source (register with the same key) or if he desires to associate this data source with some specific model factory.