Class AbstractDataContainerDbWriter<T extends DataContainer & DatabaseIDHandler>

    • Field Detail

      • m_OverwriteExisting

        protected boolean m_OverwriteExisting
        whether to replace existing containers with the new one (otherwise, nothing happens).
      • m_KeepReport

        protected boolean m_KeepReport
        whether to keep any existing report.
      • m_OutputContainer

        protected boolean m_OutputContainer
        whether to output the container rather then the ID.
    • Constructor Detail

      • AbstractDataContainerDbWriter

        public AbstractDataContainerDbWriter()
    • Method Detail

      • setPreProcessor

        public void setPreProcessor​(AbstractDataContainerPreProcessor value)
        Sets the pre-processor to apply to the data.
        Parameters:
        value - the pre-processor
      • preProcessorTipText

        public String preProcessorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOverwriteExisting

        public void setOverwriteExisting​(boolean value)
        Sets whether to remove existing containers.
        Parameters:
        value - true if to remove existing containers
      • getOverwriteExisting

        public boolean getOverwriteExisting()
        Returns whether to remove existing containers.
        Returns:
        true if to remove existing containers
      • overwriteExistingTipText

        public abstract String overwriteExistingTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setKeepReport

        public void setKeepReport​(boolean value)
        Sets whether to keep an existing report in the database.
        Parameters:
        value - true if to keep
      • getKeepReport

        public boolean getKeepReport()
        Returns whether to keep an existing report in the database.
        Returns:
        true if keep
      • keepReportTipText

        public String keepReportTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOutputContainer

        public void setOutputContainer​(boolean value)
        Sets whether to output the container rather than the ID.
        Parameters:
        value - true if to output the container
      • getOutputContainer

        public boolean getOutputContainer()
        Returns whether to output the container rather than the ID.
        Returns:
        true if to output the container
      • outputContainerTipText

        public abstract String outputContainerTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public abstract Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        the type of data to store
      • generates

        public abstract Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        the classes
      • exists

        public boolean exists​(DataProvider provider,
                              T cont)
        Returns whether the container already exists in the database.
        Specified by:
        exists in interface DataContainerDbWriter<T extends DataContainer & DatabaseIDHandler>
        Parameters:
        provider - the provider to use for checking
        cont - the container to look for
        Returns:
        true if already stored in database
      • store

        protected Integer store​(T cont)
        Stores the data container.
        Parameters:
        cont - the container
        Returns:
        the database ID, null in case of error
      • preProcess

        protected T preProcess​(T cont)
        Performs preprocessing on the container.
        Parameters:
        cont - the container to preprocess
        Returns:
        the processed container