Package de.xima.fc.workflow.parser.infix
Class ValidationOptions
- java.lang.Object
-
- de.xima.fc.workflow.parser.infix.ValidationOptions
-
- All Implemented Interfaces:
IValidationOptions
public final class ValidationOptions extends Object implements IValidationOptions
Implementation ofIValidationOptions
with a builder.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ValidationOptions.Builder
Builder for configuring anIValidationOptions
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidationOptions.Builder
builder()
Set<String>
getKnownVariables()
Locale
getLocale()
Function<String,Boolean>
getVariableExistenceCheck()
boolean
isTreatExtraneousVariablesAsError()
boolean
isTreatNonExistingVariablesAsError()
-
-
-
Method Detail
-
getKnownVariables
public Set<String> getKnownVariables()
- Specified by:
getKnownVariables
in interfaceIValidationOptions
- Returns:
- All variables that are definitely known to exist. For dynamic variables you may also use
IValidationOptions.getVariableExistenceCheck()
. Note that this is overridden by the result ofIValidationOptions.getVariableExistenceCheck()
when that return a non-null value.
-
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interfaceIValidationOptions
- Returns:
- Optional locale for localizing error messages.
Locale.ENGLISH
is used when this returnsnull
.
-
getVariableExistenceCheck
public Function<String,Boolean> getVariableExistenceCheck()
- Specified by:
getVariableExistenceCheck
in interfaceIValidationOptions
- Returns:
- A test that, given the name of a variable, checks whether that variable exists. This can be used for
dynamic variables. When this returns
null
, the result ofIValidationOptions.getKnownVariables()
is used instead. When notnull
, the result of this check overrides the result ofIValidationOptions.getKnownVariables()
. Must returntrue
when the variable exists,false
when the variable does not exist, andnull
when not certain whether it exists.
-
isTreatExtraneousVariablesAsError
public boolean isTreatExtraneousVariablesAsError()
- Specified by:
isTreatExtraneousVariablesAsError
in interfaceIValidationOptions
- Returns:
true
to create messages with severityFCMessage.ESeverity.ERROR
when a variable is found that does not occur in the expression, orfalse
to create messages withFCMessage.ESeverity.WARN
.
-
isTreatNonExistingVariablesAsError
public boolean isTreatNonExistingVariablesAsError()
- Specified by:
isTreatNonExistingVariablesAsError
in interfaceIValidationOptions
- Returns:
true
to create messages with severityFCMessage.ESeverity.ERROR
when a variable that occurs in the expression does not exist, orfalse
to create messages withFCMessage.ESeverity.WARN
.
-
builder
public static ValidationOptions.Builder builder()
- Returns:
- Creates a builder for configuring an
IValidationOptions
object.
-
-