Skip to content

Commit

Permalink
Validation interface conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 2, 2015
1 parent b5f40b6 commit 095cdf0
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 104 deletions.

This file was deleted.

Expand Up @@ -23,22 +23,38 @@
import java.util.Collection;

/**
* TODO - implement
* <p>
* A simple interface that aims to work as a custom validation plugin used in GUI.
* This plugin should be used BEFORE the changes made by user are sent for processing
* to model component.
* </p>
*
* <p>
* This plugin serves as another form of validation process and can be used, when
* standard validation mechanism of GUI forms (usually aimed to validate one field
* at a time) is not enough. A classic use case may be a situation, when we need to
* examine the relationship between attributes edited via GUI before sending them
* for processing to model component.
* </p>
*
* @author shood
* */
public class MidpointFormValidator implements IMidpointFormValidator{

@Override
public Collection<SimpleValidationError> validateObject(PrismObject<? extends ObjectType> object) {
return null;
}

@Override
public Collection<SimpleValidationError> validateObject(Collection<ObjectDelta<? extends ObjectType>> deltas) {
return null;
}
public interface MidpointFormValidator {

@Override
public Collection<SimpleValidationError> validateObject(PrismObject<? extends ObjectType> object, Collection<ObjectDelta<? extends ObjectType>> deltas) {
return null;
}
/**
* Performs a validation on an instance of object. Entire data of the object
* are accessible for validation purposes as well as a collection of ObjectDelta
* instances - the collection of current changes made by user prior to
* validation.
*
* @param object
* An object to validate
*
* @param deltas
* A collection of ObjectDelta instances - a representation of changes made by user
*
* @return A collection of SimpleValidationError instances
*
* */
Collection<SimpleValidationError> validateObject(PrismObject<? extends ObjectType> object, Collection<ObjectDelta<? extends ObjectType>> deltas);
}
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2010-2015 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.evolveum.midpoint.web.util.validation;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

import java.util.Collection;

/**
* TODO - implement
* */
public class MidpointFormValidatorImpl implements MidpointFormValidator {

@Override
public Collection<SimpleValidationError> validateObject(PrismObject<? extends ObjectType> object, Collection<ObjectDelta<? extends ObjectType>> deltas) {
return null;
}
}
Expand Up @@ -28,7 +28,7 @@
*
* @author shood
* */
public class SimpleValidationError implements Serializable{
public class SimpleValidationError implements Serializable {

private String message;
private ItemPathType attribute;
Expand Down

0 comments on commit 095cdf0

Please sign in to comment.