Class JsRegExpCheck
java.lang.Object
de.xima.fc.form.renderer.JsRegExpCheck
-
Constructor Summary
ConstructorsConstructorDescriptionJsRegExpCheck(Object[] args) Creates a new regexp check with the given regexp and flags.JsRegExpCheck(String regExp, String... flags) -
Method Summary
Modifier and TypeMethodDescriptionbooleanwithInstructionThreshold(long instructionThreshold) Changes the default instruction threshold.withTimeout(long timeout, TimeUnit unit) Changes the default timeout.
-
Constructor Details
-
JsRegExpCheck
Creates a new regexp check with the given regexp and flags.- Parameters:
args- An array that contains the regexp (String) as the first item, and optional String flags as the second, third, etc. item. Currently onlyi,g, andmflags are supported by the regexp engine.
-
JsRegExpCheck
-
-
Method Details
-
test
-
withTimeout
Changes the default timeout. When the regexp check takes longer than this timeout, the check is aborted and the regexp is considered not to match the input.- Parameters:
timeout- Timeout for the regexp check.unit- Unit of the given timeout value.- Returns:
- A new regexp check with the given timeout.
-
withInstructionThreshold
Changes the default instruction threshold. When the regexp check exceeds this threshold, the check is aborted and the regexp is considered not to match the input. Each iteration of the regexp engine is counted as a small increment of the instruction count.- Parameters:
instructionThreshold- Instruction threshold for the regexp check.- Returns:
- A new regexp check with the given instruction threshold.
-