Class SourceProvider

  • All Implemented Interfaces:
    Iterator<Source>
    Direct Known Subclasses:
    FileSourceProvider, JdbcMetadataSourceProvider

    public abstract class SourceProvider
    extends Object
    implements Iterator<Source>
    The input for a generation process. It can contain several sources. In order to use the sources, the init() method must be called. After this method was called, no more setters may be called.
    • Constructor Detail

      • SourceProvider

        public SourceProvider()
    • Method Detail

      • init

        public final void init​(ConfigurationHandlers configurationHandlers,
                               ControllerState controllerState)
                        throws ConfigurationException
        Initializes the source provider. Must be called before hasNext() or next() is invoked.
        Parameters:
        configurationHandlers - the configuration handlers, not null.
        controllerState - the current controller state, not null.
        Throws:
        ConfigurationException - if initializing fails.
      • reset

        public final void reset​(ConfigurationHandlers configurationHandlers,
                                ControllerState controllerState)
                         throws ConfigurationException
        Resets the source provider. After this method is called, init() must be called again.
        Parameters:
        configurationHandlers - the configuration handlers, not null.
        controllerState - the current controller state, not null.
        Throws:
        ConfigurationException - if resetting fails.
      • initInternal

        protected abstract void initInternal​(ConfigurationHandlers configurationHandlers,
                                             ControllerState controllerState)
                                      throws ConfigurationException
        Initializes the sources provided by this SourceProvider.
        Parameters:
        configurationHandlers - the configuration handlers, not null.
        controllerState - the current controller state, not null.
        Throws:
        ConfigurationException - if initializing fails.
      • resetInternal

        protected abstract void resetInternal​(ConfigurationHandlers configurationHandlers,
                                              ControllerState controllerState)
                                       throws ConfigurationException
        Resets the sources provided by this SourceProvider.
        Parameters:
        configurationHandlers - the configuration handlers, not null.
        controllerState - the current controller state, not null.
        Throws:
        ConfigurationException - if resetting fails.
      • isInit

        public boolean isInit()
        Returns whether init() was already called.
        Returns:
        true if init() was already called, false otherwise.
      • copyNotSetSettingsFrom

        public abstract void copyNotSetSettingsFrom​(SourceProvider sourceProvider)
        Copies settings which are not set in this source provider from another source provider. This only works if the type of the other source provider is known to this source provider. Only a subset of all properties are typically used for overwriting. No Properties which are already set are overwritten.
        Parameters:
        sourceProvider - the source provoder to copy the settings from.