
package de.ivu.elect.jee.entity;

import java.io.Serializable;

import javax.enterprise.context.RequestScoped;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;

@RequestScoped
public class EntityValidationRequestScope implements Serializable {

  private transient Validator validator;

  public Validator getValidator(ValidatorFactory factory) {
    if (validator == null) {
      validator = factory.getValidator();
    }
    return validator;
  }
}
