Class MaxLengthValidatorImpl
java.lang.Object
de.hybris.platform.sap.productconfig.frontend.validator.impl.MaxLengthValidatorImpl
- All Implemented Interfaces:
CsticValueValidator
Enforeces that a cstic value does not exceed the maximum length.
This is also checked on the UI, for example by setting the maxLength attribute of the corresponding input field. However we can not no trust the UI. An attacker might manipulate the request and/or the UI to inject malicious code by sending much longer values. Enforcing the maxLength of the value, makes it much more difficult for an Atttacker to inject malicious code.
This is also checked on the UI, for example by setting the maxLength attribute of the corresponding input field. However we can not no trust the UI. An attacker might manipulate the request and/or the UI to inject malicious code by sending much longer values. Enforcing the maxLength of the value, makes it much more difficult for an Atttacker to inject malicious code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanprotected intgetMaxLength(CsticData cstic) protected intValidates the value of the cstic.
-
Constructor Details
-
MaxLengthValidatorImpl
public MaxLengthValidatorImpl()
-
-
Method Details
-
getMaxLengthFallback
protected int getMaxLengthFallback() -
validate
public String validate(CsticData cstic, org.springframework.validation.Errors errorObj, String value) Description copied from interface:CsticValueValidatorValidates the value of the cstic.- Specified by:
validatein interfaceCsticValueValidator- Parameters:
cstic- to access any meta data for validationerrorObj- to add errors if foundvalue- actual value to check- Returns:
- modified value, or
nullif no value modification is required
-
getMaxLength
-
appliesTo
- Specified by:
appliesToin interfaceCsticValueValidator- Returns:
trueonly if this validator is apllicable to this cstic
-
appliesToValues
public boolean appliesToValues()- Specified by:
appliesToValuesin interfaceCsticValueValidator- Returns:
trueonly if this validator is apllicable to this cstic values
-
appliesToFormattedValues
public boolean appliesToFormattedValues()- Specified by:
appliesToFormattedValuesin interfaceCsticValueValidator- Returns:
trueonly if this validator is apllicable to formatted cstic values
-
appliesToAdditionalValues
public boolean appliesToAdditionalValues()- Specified by:
appliesToAdditionalValuesin interfaceCsticValueValidator- Returns:
trueonly if this validator is apllicable to additional cstic values
-