Class PropertyValidationResult
- java.lang.Object
-
- org.apache.sling.feature.extension.apiregions.api.config.validation.PropertyValidationResult
-
public class PropertyValidationResult extends Object
Validation result for a property This class is not thread safe.
-
-
Constructor Summary
Constructors Constructor Description PropertyValidationResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetDefaultValue()Get the default value.List<String>getErrors()IfisValid()returnsfalsethis returns a list of human readable errors.String[]getUseExcludes()Get the excludes to be usedString[]getUseIncludes()Get the includes to be usedList<String>getWarnings()Return the list of warningsbooleanisSkipped()Has the validation for this property be skipped?booleanisUseDefaultValue()Should the default be used instead of the configuration value?booleanisValid()Is the property value valid?voidmarkSkipped()Mark 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.
-
-
-
Method Detail
-
isValid
public boolean isValid()
Is the property value valid?- Returns:
trueif the value is valid
-
getErrors
public List<String> getErrors()
IfisValid()returnsfalsethis returns a list of human readable errors.- Returns:
- A list of errors - empty if
isValid()returnstrue
-
getWarnings
public List<String> 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:
getDefaultValue()
-
setUseDefaultValue
public void setUseDefaultValue(boolean useDefault)
Set whether the default value should be used- Parameters:
useDefault- boolean flag- Since:
- 1.2
-
getDefaultValue
public Object getDefaultValue()
Get the default value. The default value is only returned ifisUseDefaultValue()returnstrue.- Returns:
- the defaultValue (it might be
null) - Since:
- 1.2
-
setDefaultValue
public void setDefaultValue(Object defaultValue)
Set the default value- Parameters:
defaultValue- the defaultValue to set- Since:
- 1.2
-
getUseExcludes
public String[] getUseExcludes()
Get the excludes to be used- Returns:
- The excludes or
null - Since:
- 1.6
-
getUseIncludes
public String[] getUseIncludes()
Get the includes to be used- Returns:
- The includes or
null - Since:
- 1.6
-
-