Skip to content

Commit

Permalink
setter for valid name pattern in EdmNamedImplProv (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliyan-velichkov committed Apr 19, 2024
1 parent a1e4199 commit 9e9229a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
*/
public abstract class EdmNamedImplProv implements EdmNamed {

private static final Pattern DEFAULT_PATTERN_VALID_NAME = Pattern.compile(
"\\A[_\\p{L}\\p{Nl}][_\\p{L}\\p{Nl}\\p{Nd}\\p{Mn}\\p{Mc}\\p{Pc}\\p{Cf}]{0,}\\Z");

/** The Constant PATTERN_VALID_NAME. */
private static final Pattern PATTERN_VALID_NAME = Pattern.compile(
"\\A[_\\p{L}\\p{Nl}][_\\p{L}\\p{Nl}\\p{Nd}\\p{Mn}\\p{Mc}\\p{Pc}\\p{Cf}]{0,}\\Z");

private static Pattern PATTERN_VALID_NAME = DEFAULT_PATTERN_VALID_NAME;

/** The edm. */
protected EdmImplProv edm;

Expand Down Expand Up @@ -98,4 +100,8 @@ private String getValidatedName(final String name) throws EdmException {
}
throw new EdmException(EdmException.NAMINGERROR.addContent(name));
}

public static void setValidNamePattern(Pattern pattern) {
PATTERN_VALID_NAME = pattern;
}
}

0 comments on commit 9e9229a

Please sign in to comment.