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 Object
getDefaultValue()
Get the default value.List<String>
getErrors()
IfisValid()
returnsfalse
this 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 warningsboolean
isSkipped()
Has the validation for this property be skipped?boolean
isUseDefaultValue()
Should the default be used instead of the configuration value?boolean
isValid()
Is the property value valid?void
markSkipped()
Mark the property to be skipped during validationvoid
setDefaultValue(Object defaultValue)
Set the default valuevoid
setUseDefaultValue(boolean useDefault)
Set whether the default value should be usedvoid
setUseIncludesAndExcludes(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:
true
if the value is valid
-
getErrors
public List<String> getErrors()
IfisValid()
returnsfalse
this 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:
true
if 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:
true
if 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
-
-