diff -r c4b901ff0703 -r 099bb96f8d8d java/sql-dk/src/main/java/info/globalcode/sql/dk/configuration/Properties.java --- a/java/sql-dk/src/main/java/info/globalcode/sql/dk/configuration/Properties.java Fri Sep 23 18:05:50 2022 +0200 +++ b/java/sql-dk/src/main/java/info/globalcode/sql/dk/configuration/Properties.java Sun Feb 04 16:10:37 2024 +0100 @@ -20,15 +20,16 @@ import javax.xml.bind.annotation.XmlTransient; import static info.globalcode.sql.dk.Functions.findByName; import java.util.Collections; +import java.util.regex.Pattern; /** *

* List of configurables.

* *

- * Can be backed by defaults – if value for given name is nof found in this instance, we will - * look into defaults. Methods also accept defaultValue parameter – is used if property is nof found - * even in default properties.

+ * Can be backed by defaults – if value for given name is nof found in this + * instance, we will look into defaults. Methods also accept defaultValue + * parameter – is used if property is nof found even in default properties.

* *

* Typical use:

@@ -94,6 +95,11 @@ return p == null ? defaultValue : Integer.valueOf(p.getValue()); } + public Pattern getPattern(String name, Pattern defaultValue) { + Property p = findProperty(name); + return p == null ? defaultValue : Pattern.compile(p.getValue()); + } + public boolean hasProperty(String name) { return findByName(this, name) != null; }