Package de.calamanari.adl.sql.config
Class ConfigUtils
java.lang.Object
de.calamanari.adl.sql.config.ConfigUtils
Set of utilities, mainly for validation to avoid duplication.
- Author:
- Karl Eilebrecht
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertContextNotNull(de.calamanari.adl.ProcessContext ctx) static voidassertValidArgName(String argName) static booleanisValidArgName(String argName) static booleanisValidColumnName(String name) Validates the given column name.static booleanisValidTableName(String name) Validates the given table name.
-
Method Details
-
assertValidArgName
- 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
- Parameters:
argName-- Returns:
- true if the argName is acceptable (not null, not blank)
-
isValidTableName
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
- In unquoted form, table names and column names may contain:
-
isValidColumnName
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
- In unquoted form, table names and column names may contain:
-