Class ConfigUtils

java.lang.Object
de.calamanari.adl.sql.config.ConfigUtils

public class ConfigUtils extends Object
Set of utilities, mainly for validation to avoid duplication.
Author:
Karl Eilebrecht
  • Method Details

    • assertValidArgName

      public static void assertValidArgName(String argName)
      Parameters:
      argName -
      Throws:
      IllegalArgumentException - if the argName is null or blank
    • assertContextNotNull

      public static void assertContextNotNull(de.calamanari.adl.ProcessContext ctx)
      Parameters:
      ctx - object
      Throws:
      IllegalArgumentException - if the settings is null
    • isValidArgName

      public static boolean isValidArgName(String argName)
      Parameters:
      argName -
      Returns:
      true if the argName is acceptable (not null, not blank)
    • isValidTableName

      public static boolean isValidTableName(String name)
      Validates the given table name.

      This is a best-guess implementation (applicable to many databases) to help detecting configuration errors early.

      • In unquoted form, table names and column names may contain: [0-9,a-z,A-Z$_] (ciphers 0-9, basic Latin letters (lowercase and uppercase), dollar sign, underscore)
      • Quoted table and column names are accepted within backticks, e.g. `name`.
      Parameters:
      name -
      Returns:
      true if the given table name is invalid
    • isValidColumnName

      public static boolean isValidColumnName(String name)
      Validates the given column name.

      This is a best-guess implementation (applicable to many databases) to help detecting configuration errors early.

      • In unquoted form, table names and column names may contain: [0-9,a-z,A-Z$_] (ciphers 0-9, basic Latin letters (lowercase and uppercase), dollar sign, underscore)
      • Quoted table and column names are accepted within backticks, e.g. `name`.
      Parameters:
      name -
      Returns:
      true if the given column name is invalid