@Component(value="blUriPropertyValidator") public class UriPropertyValidator extends ValidationConfigurationBasedPropertyValidator
| Modifier and Type | Field and Description |
|---|---|
protected String |
ERROR_KEY_BEGIN_WITH_SLASH |
protected String |
ERROR_KEY_CANNOT_CONTAIN_SPACES |
protected String |
ERROR_KEY_CANNOT_END_WITH_SLASH |
protected static org.apache.commons.logging.Log |
LOG |
protected boolean |
succeedForNullValues
Denotes what should occur when this validator encounters a null value to validate against.
|
| Constructor and Description |
|---|
UriPropertyValidator() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
getAllowTrailingSlash() |
protected boolean |
getIgnoreFullUrls() |
protected boolean |
getRequireLeadingSlash() |
boolean |
isFullUrl(String url) |
boolean |
isSucceedForNullValues() |
void |
setSucceedForNullValues(boolean succeedForNullValues) |
PropertyValidationResult |
validate(Entity entity,
Serializable instance,
Map<String,FieldMetadata> entityFieldMetadata,
Map<String,String> validationConfiguration,
BasicFieldMetadata propertyMetadata,
String propertyName,
String value)
Validates a property for an entity
|
validateInternalprotected static final org.apache.commons.logging.Log LOG
protected String ERROR_KEY_BEGIN_WITH_SLASH
protected String ERROR_KEY_CANNOT_END_WITH_SLASH
protected String ERROR_KEY_CANNOT_CONTAIN_SPACES
protected boolean succeedForNullValues
protected boolean getIgnoreFullUrls()
protected boolean getRequireLeadingSlash()
protected boolean getAllowTrailingSlash()
public boolean isFullUrl(String url)
public PropertyValidationResult validate(Entity entity, Serializable instance, Map<String,FieldMetadata> entityFieldMetadata, Map<String,String> validationConfiguration, BasicFieldMetadata propertyMetadata, String propertyName, String value)
PropertyValidatorvalidate in interface PropertyValidatorvalidate in class ValidationConfigurationBasedPropertyValidatorentity - Entity DTO of the entity attempting to saveinstance - actual object representation of entity. This can be cast to entity interfaces (like Sku or
Product)entityFieldMetadata - complete field metadata for all properties in entityvalidationConfiguration - the map represented by the set of ConfigurationItem for a
ValidationConfiguration on a property. This map could be null if this PropertyValidator is being
invoked outside of the context of a particular property (like a global validator)propertyMetadata - BasicFieldMetadata corresponding to the property that is being validpropertyName - the property name of the value attempting to be saved (could be a sub-entity obtained via dot
notation like 'defaultSku.name')value - the value attempted to be savedpublic boolean isSucceedForNullValues()
public void setSucceedForNullValues(boolean succeedForNullValues)
Copyright © 2015. All rights reserved.