Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.datenstrudel.bulbs.shared.domain.validation;

Domain validator

Parameters:
<T> Specific handler for type of Object beeing validated
Author(s):
Thomas Wendzinski
 
 public abstract class Validator<T extends Validator.ValidationNotificationHandler> {
     
    //~ Member(s) //////////////////////////////////////////////////////////////
    private final T notificationHandler;
    //~ Construction ///////////////////////////////////////////////////////////
    public Validator(T notificationHandler) {
        super();
        assert(notificationHandler != null);
        this. = notificationHandler;
    }
    
    //~ Method(s) //////////////////////////////////////////////////////////////
    

Throws:
ValidationException in case a validation error occurs
    public abstract void validateNew() throws ValidationException;
    

Throws:
ValidationException in case a validation error occurs
    public abstract void validateExisting() throws ValidationException;
    
    public T notificationHandler(){
        return ;
    }
    
    
Marker interface to be refined for specific members that shall be validatable.
    public static interface ValidationNotificationHandler{}
    
    //~ Private Artifact(s) ////////////////////////////////////////////////////
New to GrepCode? Check out our FAQ X