Class PropertyValidationResult
java.lang.Object
org.apache.sling.feature.extension.apiregions.api.config.validation.PropertyValidationResult
Validation result for a property
This class is not thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the default value.IfisValid()returnsfalsethis returns a list of human readable errors.String[]Get the excludes to be usedString[]Get the includes to be usedReturn the list of warningsbooleanHas the validation for this property be skipped?booleanShould the default be used instead of the configuration value?booleanisValid()Is the property value valid?voidMark the property to be skipped during validationvoidsetDefaultValue(Object defaultValue) Set the default valuevoidsetUseDefaultValue(boolean useDefault) Set whether the default value should be usedvoidsetUseIncludesAndExcludes(String[] includes, String[] excludes) Set whether the excludes and includes should be used.
-
Constructor Details
-
PropertyValidationResult
public PropertyValidationResult()
-
-
Method Details
-
isValid
public boolean isValid()Is the property value valid?- Returns:
trueif the value is valid
-
getErrors
IfisValid()returnsfalsethis returns a list of human readable errors.- Returns:
- A list of errors - empty if
isValid()returnstrue
-
getWarnings
Return the list of warnings- Returns:
- The list of warnings - might be empty
-
isSkipped
public boolean isSkipped()Has the validation for this property be skipped?- Returns:
trueif it has been skipped
-
markSkipped
public void markSkipped()Mark the property to be skipped during validation -
isUseDefaultValue
public boolean isUseDefaultValue()Should the default be used instead of the configuration value?- Returns:
trueif the default should be used.- Since:
- 1.2
- See Also:
-
setUseDefaultValue
public void setUseDefaultValue(boolean useDefault) Set whether the default value should be used- Parameters:
useDefault- boolean flag- Since:
- 1.2
-
getDefaultValue
Get the default value. The default value is only returned ifisUseDefaultValue()returnstrue.- Returns:
- the defaultValue (it might be
null) - Since:
- 1.2
-
setDefaultValue
Set the default value- Parameters:
defaultValue- the defaultValue to set- Since:
- 1.2
-
getUseExcludes
Get the excludes to be used- Returns:
- The excludes or
null - Since:
- 1.6
-
getUseIncludes
Get the includes to be used- Returns:
- The includes or
null - Since:
- 1.6
-
setUseIncludesAndExcludes
Set whether the excludes and includes should be used. At least one of it should not benull- Parameters:
includes- The includes to useexcludes- The excludes to use- Since:
- 1.6
-