feat(configmanager): add NonMatchBehavior enum and regex properties to TransformerModel
Add configuration model support for the new Regex transformer including: - NonMatchBehavior enum with JSON string serialization - ColumnName, Pattern, Replacement, IgnoreCase, NonMatchBehavior properties
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace JdeScoping.ConfigManager.Models;
|
||||
|
||||
/// <summary>
|
||||
@@ -212,4 +214,43 @@ public class TransformerModel
|
||||
/// Gets or sets the output column name for JdeDate transformer.
|
||||
/// </summary>
|
||||
public string? OutputColumn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the column name for Regex transformer.
|
||||
/// </summary>
|
||||
public string? ColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the regex pattern for Regex transformer.
|
||||
/// </summary>
|
||||
public string? Pattern { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the replacement string for Regex transformer (null = Match & Extract mode).
|
||||
/// </summary>
|
||||
public string? Replacement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether regex matching is case-insensitive.
|
||||
/// </summary>
|
||||
public bool IgnoreCase { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the behavior when regex pattern does not match.
|
||||
/// </summary>
|
||||
public NonMatchBehavior NonMatchBehavior { get; set; } = NonMatchBehavior.KeepOriginal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies behavior when a regex pattern does not match the input value.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum NonMatchBehavior
|
||||
{
|
||||
/// <summary>Keep the original value unchanged.</summary>
|
||||
KeepOriginal,
|
||||
/// <summary>Return null/DBNull.</summary>
|
||||
ReturnNull,
|
||||
/// <summary>Return an empty string.</summary>
|
||||
ReturnEmpty
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user