Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
05b8091
TEDEFO-4870 Fix string(number) to use XPath string() instead of forma…
rousso Feb 13, 2026
381b782
TEDEFO-4871 Add string(boolean) type conversion
rousso Feb 13, 2026
b7525a3
TEDEFO-4872 Add string(date) type conversion
rousso Feb 13, 2026
802dfaa
TEDEFO-4873 Add string(time) type conversion
rousso Feb 13, 2026
fbfdba0
TEDEFO-4874 Add string(duration) type conversion
rousso Feb 13, 2026
4375bd5
TEDEFO-4875 Add number(boolean) and indicator(number) type conversions
rousso Feb 14, 2026
d0c5665
TEDEFO-4870 Rename string() conversion to text() with string as alias
rousso Feb 14, 2026
225e8ff
TEDEFO-4877 Add sort() function to EFX toolkit
rousso Feb 14, 2026
1463ffc
TEDEFO-4878 Add reverse() function to EFX toolkit
rousso Feb 14, 2026
aa8427a
TEDEFO-4879 Add subsequence() function to EFX toolkit
rousso Feb 14, 2026
195ab2d
TEDEFO-4788 Add index-of() function to EFX toolkit
rousso Feb 14, 2026
724adcc
TEDEFO-4883 Add sequence is [not] empty and string empty() function
rousso Feb 14, 2026
53d3fbf
TEDEFO-4880 Add sequence has [no] duplicates and clean up imports
rousso Feb 15, 2026
9109046
Add javadoc to sequence-related ScriptGenerator methods
rousso Feb 15, 2026
79a03de
Add javadoc to type conversion ScriptGenerator methods
rousso Feb 15, 2026
a2ba57d
Merge branch 'TEDEFO-4869-add-type-conversion-functions' into TEDEFO-…
rousso Feb 15, 2026
d82e2b1
TEDEFO-4788 Change index-of to return first occurrence only
rousso Feb 15, 2026
967e782
TEDEFO-4885 Implement normalize-space() function
rousso Feb 15, 2026
e883263
TEDEFO-4888 Implement trim, trim-left, trim-right functions
rousso Feb 15, 2026
21b75e8
TEDEFO-4889 Implement pad-left and pad-right functions
rousso Feb 15, 2026
f61b8cf
TEDEFO-4892 Implement repeat() function
rousso Feb 15, 2026
bcbc91e
TEDEFO-4890 Implement split() function with literal delimiter
rousso Feb 15, 2026
0a03272
TEDEFO-4891 Implement substring-before and substring-after functions
rousso Feb 15, 2026
057c570
TEDEFO-4895 Implement index-of-substring() function
rousso Feb 15, 2026
3a0ac14
TEDEFO-4886 Implement replace and replace-regex functions
rousso Feb 15, 2026
3544df6
TEDEFO-4893 Implement url-encode() function
rousso Feb 15, 2026
b05422e
TEDEFO-4894 Implement capitalize-first() function
rousso Feb 15, 2026
a16d446
TEDEFO-4897 Add scalar math functions (absolute, round, round-down, r…
rousso Feb 15, 2026
9621b95
TEDEFO-4898 Add aggregate math functions (min, max, average)
rousso Feb 15, 2026
7a5d3c4
TEDEFO-4900 Add date component extraction functions (year, month, day)
rousso Feb 15, 2026
8beee6f
TEDEFO-4901 Add time component extraction functions (hours, minutes, …
rousso Feb 15, 2026
8087f3a
TEDEFO-4902 Add locale-aware formatting functions (format-short/mediu…
rousso Feb 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.antlr.v4.runtime.misc.ParseCancellationException;

/**
* Exception thrown when field validation fails during EFX template processing.
* Exception thrown when an EFX construct is used incorrectly, such as referencing
* a non-withholdable field for privacy properties, or calling a template-only
* function in an expression or validation rule.
*/
@SuppressWarnings("squid:MaximumInheritanceDepth") // Necessary to integrate with ANTLR4 parser cancellation
public class InvalidUsageException extends ParseCancellationException {
Expand All @@ -26,14 +28,16 @@ public enum ErrorCode {
SHORTHAND_REQUIRES_FIELD_CONTEXT,
INVALID_NOTICE_SUBTYPE_RANGE_ORDER,
INVALID_NOTICE_SUBTYPE_TOKEN,
FIELD_NOT_WITHHOLDABLE
FIELD_NOT_WITHHOLDABLE,
TEMPLATE_ONLY_FUNCTION
}

private static final String SHORTHAND_REQUIRES_CODE_OR_INDICATOR = "Indirect label reference shorthand #{%1$s}, requires a field of type 'code' or 'indicator'. Field %1$s is of type %2$s.";
private static final String SHORTHAND_REQUIRES_FIELD_CONTEXT = "The %s shorthand syntax can only be used when a field is declared as context.";
private static final String INVALID_NOTICE_SUBTYPE_RANGE_ORDER = "Notice subtype range '%s-%s' is not in ascending order.";
private static final String INVALID_NOTICE_SUBTYPE_TOKEN = "Invalid notice subtype token '%s'. Expected format: 'X' or 'X-Y'.";
private static final String FIELD_NOT_WITHHOLDABLE = "Field '%s' is always published and cannot be withheld from publication.";
private static final String TEMPLATE_ONLY_FUNCTION = "Function '%s' can only be used in templates, not in expressions or validation rules.";

private final ErrorCode errorCode;

Expand Down Expand Up @@ -65,4 +69,8 @@ public static InvalidUsageException invalidNoticeSubtypeToken(String token) {
public static InvalidUsageException fieldNotWithholdable(String fieldId) {
return new InvalidUsageException(ErrorCode.FIELD_NOT_WITHHOLDABLE, String.format(FIELD_NOT_WITHHOLDABLE, fieldId));
}

public static InvalidUsageException templateOnlyFunction(String functionName) {
return new InvalidUsageException(ErrorCode.TEMPLATE_ONLY_FUNCTION, String.format(TEMPLATE_ONLY_FUNCTION, functionName));
}
}
Loading
Loading