Package de.xima.fc.form.renderer
Class JsRegExpCheck
- java.lang.Object
-
- de.xima.fc.form.renderer.JsRegExpCheck
-
-
Constructor Summary
Constructors Constructor Description JsRegExpCheck(Object[] args)
Creates a new regexp check with the given regexp and flags.JsRegExpCheck(String regExp, String... flags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
test(String value)
JsRegExpCheck
withInstructionThreshold(long instructionThreshold)
Changes the default instruction threshold.JsRegExpCheck
withTimeout(long timeout, TimeUnit unit)
Changes the default timeout.
-
-
-
Constructor Detail
-
JsRegExpCheck
public JsRegExpCheck(Object[] args)
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
, andm
flags are supported by the regexp engine.
-
-
Method Detail
-
withTimeout
public JsRegExpCheck withTimeout(long timeout, TimeUnit unit)
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
public JsRegExpCheck withInstructionThreshold(long instructionThreshold)
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.
-
-