Package adams.data.id

Class IDGeneratorPostProcessor

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, ShallowCopySupporter, SizeOfHandler, Serializable, Comparable

    public class IDGeneratorPostProcessor
    extends AbstractIDGenerator
    A simple ID generator that can make use of data provided by classes implementing IDHandler and DatabaseIDHandler.

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to
        the console (0 = off).
        default: 0
        minimum: 0
     
    -generator <adams.data.id.AbstractIDGenerator [options]> (property: generator)
        The generator to use for generating the IDs.
        default: adams.data.id.SimpleIDGenerator
     
    -find <java.lang.String> (property: find)
        The string to find (a regular expression).
        default: find
     
    -replace <java.lang.String> (property: replace)
        The string to replace the occurrences with.
        default:
     
    -all (property: replaceAll)
        If set to true, then all occurrences will be replaced; otherwise only the
        first.
     
    -placeholder (property: replaceContainsPlaceholder)
        Set this to true to enable automatic placeholder expansion for the replacement
        string.
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Find

        protected String m_Find
        the string to find (regexp).
      • m_Replace

        protected String m_Replace
        the replacement string.
      • m_ReplaceAll

        protected boolean m_ReplaceAll
        whether to replace all or only the first occurrence.
      • m_ReplaceContainsPlaceholder

        protected boolean m_ReplaceContainsPlaceholder
        whether the replace string contains a placeholder, which needs to be expanded first.
    • Constructor Detail

      • IDGeneratorPostProcessor

        public IDGeneratorPostProcessor()
    • Method Detail

      • setGenerator

        public void setGenerator​(AbstractIDGenerator value)
        Sets the generator to use.
        Parameters:
        value - the generator
      • getGenerator

        public AbstractIDGenerator getGenerator()
        Returns the generator in use.
        Returns:
        the generator
      • generatorTipText

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

        public void setFind​(String value)
        Sets the string to find (regular expression).
        Parameters:
        value - the string
      • getFind

        public String getFind()
        Returns the string to find (regular expression).
        Returns:
        the string
      • findTipText

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

        public void setReplace​(String value)
        Sets the string to replace the occurrences with.
        Parameters:
        value - the string
      • getReplace

        public String getReplace()
        Returns the string to replace the occurences with.
        Returns:
        the string
      • replaceTipText

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

        public void setReplaceAll​(boolean value)
        Sets whether all occurrences are replaced or only the first.
        Parameters:
        value - true if all are to be replaced, false if only the first
      • getReplaceAll

        public boolean getReplaceAll()
        Returns whether all occurrences are replaced or only the first one.
        Returns:
        true if all are to be replaced, false if only the first
      • replaceAllTipText

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

        public void setReplaceContainsPlaceholder​(boolean value)
        Sets whether the replace string contains a placeholder which needs to be expanded first.
        Parameters:
        value - true if replace string contains a placeholder
      • getReplaceContainsPlaceholder

        public boolean getReplaceContainsPlaceholder()
        Returns whether the replace string contains a placeholder which needs to be expanded first.
        Returns:
        true if replace string contains a placeholder
      • replaceContainsPlaceholderTipText

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

        protected String assemble​(Object o)
        Generates the actual ID.
        Specified by:
        assemble in class AbstractIDGenerator
        Parameters:
        o - the object to generate the ID for
        Returns:
        the generated ID