- @Override
- public PfValidationResult validate(PfValidationResult resultIn) {
- PfValidationResult result = resultIn;
-
- if (key.isNullKey()) {
- result.addValidationMessage(
- new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
- }
-
- result = key.validate(result);
-
- if (derivedFrom != null && derivedFrom.isNullKey()) {
- result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "derived from key is a null key"));
- }
-
- if (metadata != null) {
- for (Entry<String, String> metadataEntry : metadata.entrySet()) {
- if (!ParameterValidationUtils.validateStringParameter(metadataEntry.getKey())) {
- result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "property metadata key may not be null"));
- }
- if (!ParameterValidationUtils.validateStringParameter(metadataEntry.getValue())) {
- result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "property metadata value may not be null"));
- }
- }
- }
-
- if (description != null && description.trim().length() == 0) {
- result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "property description may not be blank"));
- }
-
- return result;
- }
-