Coverage Report - org.kuali.student.core.comment.service.impl.CommentServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
CommentServiceImpl
75%
114/152
64%
18/28
2.333
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.core.comment.service.impl;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import javax.jws.WebService;
 21  
 import javax.persistence.NoResultException;
 22  
 
 23  
 import org.apache.log4j.Logger;
 24  
 import org.kuali.student.common.dictionary.dto.ObjectStructureDefinition;
 25  
 import org.kuali.student.common.dictionary.service.DictionaryService;
 26  
 import org.kuali.student.common.dto.ReferenceTypeInfo;
 27  
 import org.kuali.student.common.dto.StatusInfo;
 28  
 import org.kuali.student.common.exceptions.AlreadyExistsException;
 29  
 import org.kuali.student.common.exceptions.DataValidationErrorException;
 30  
 import org.kuali.student.common.exceptions.DoesNotExistException;
 31  
 import org.kuali.student.common.exceptions.InvalidParameterException;
 32  
 import org.kuali.student.common.exceptions.MissingParameterException;
 33  
 import org.kuali.student.common.exceptions.OperationFailedException;
 34  
 import org.kuali.student.common.exceptions.PermissionDeniedException;
 35  
 import org.kuali.student.common.exceptions.VersionMismatchException;
 36  
 import org.kuali.student.common.search.service.SearchManager;
 37  
 import org.kuali.student.common.validation.dto.ValidationResultInfo;
 38  
 import org.kuali.student.common.validator.Validator;
 39  
 import org.kuali.student.common.validator.ValidatorFactory;
 40  
 import org.kuali.student.core.comment.dao.CommentDao;
 41  
 import org.kuali.student.core.comment.dto.CommentInfo;
 42  
 import org.kuali.student.core.comment.dto.CommentTypeInfo;
 43  
 import org.kuali.student.core.comment.dto.TagInfo;
 44  
 import org.kuali.student.core.comment.dto.TagTypeInfo;
 45  
 import org.kuali.student.core.comment.entity.Comment;
 46  
 import org.kuali.student.core.comment.entity.CommentType;
 47  
 import org.kuali.student.core.comment.entity.Reference;
 48  
 import org.kuali.student.core.comment.entity.ReferenceType;
 49  
 import org.kuali.student.core.comment.entity.Tag;
 50  
 import org.kuali.student.core.comment.entity.TagType;
 51  
 import org.kuali.student.core.comment.service.CommentService;
 52  
 import org.springframework.transaction.annotation.Transactional;
 53  
 
 54  
 /**
 55  
  * Implementation of the Comment Search Service
 56  
  *
 57  
  * @author Kuali Rice Team (kuali-rice@googlegroups.com)
 58  
  *
 59  
  */
 60  
 @WebService(endpointInterface = "org.kuali.student.core.comment.service.CommentService", serviceName = "CommentService", portName = "CommentService", targetNamespace = "http://student.kuali.org/wsdl/commentService")
 61  
 @Transactional(readOnly=true,noRollbackFor={DoesNotExistException.class},rollbackFor={Throwable.class})
 62  2
 public class CommentServiceImpl implements CommentService {
 63  
     
 64  2
     final Logger logger = Logger.getLogger(CommentServiceImpl.class);
 65  
     
 66  
     private CommentDao commentDao;
 67  
     private DictionaryService dictionaryServiceDelegate;
 68  
     private SearchManager searchManager;
 69  
     private ValidatorFactory validatorFactory;
 70  
 
 71  
     /**
 72  
      * This overridden method ...
 73  
      *
 74  
      * @see org.kuali.student.core.comment.service.CommentService#addComment(java.lang.String, java.lang.String, org.kuali.student.core.comment.dto.CommentInfo)
 75  
      */
 76  
     @Override
 77  
     @Transactional(readOnly=false)
 78  
         public CommentInfo addComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo) throws DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 79  4
         commentInfo.setReferenceTypeKey(referenceTypeKey);
 80  4
         commentInfo.setReferenceId(referenceId);
 81  
             
 82  
         // Validate Comment
 83  4
         List<ValidationResultInfo> validationResults = null;
 84  
         try {
 85  4
             validationResults = validateComment("OBJECT", commentInfo);
 86  0
         } catch (DoesNotExistException e1) {
 87  0
             throw new OperationFailedException("Validation call failed." + e1.getMessage());
 88  4
         }
 89  4
         if (null != validationResults && validationResults.size() > 0) {
 90  0
             throw new DataValidationErrorException("Validation error!", validationResults);
 91  
         }
 92  
         
 93  4
         Reference reference=null;
 94  4
         reference = commentDao.getReference(referenceId, referenceTypeKey);
 95  4
         if(reference==null){
 96  3
             reference = new Reference();
 97  3
             reference.setReferenceId(referenceId);
 98  
                         try {
 99  3
                                 ReferenceType referenceType = commentDao.fetch(ReferenceType.class, referenceTypeKey);
 100  3
                     reference.setReferenceType(referenceType);
 101  3
                     commentDao.create(reference);
 102  0
                         } catch (DoesNotExistException e) {
 103  0
                                 throw new InvalidParameterException(e.getMessage());
 104  3
                         }
 105  
         }
 106  
 
 107  4
         Comment comment = null;
 108  
 
 109  
         try {
 110  4
             comment = CommentServiceAssembler.toComment(false, commentInfo, commentDao);
 111  0
         } catch (DoesNotExistException e) {
 112  0
             throw new InvalidParameterException(e.getMessage());
 113  4
         }
 114  
 
 115  4
         Comment createdComment = commentDao.create(comment);
 116  
 
 117  4
         CommentInfo createdCommentInfo = CommentServiceAssembler.toCommentInfo(createdComment);
 118  
 
 119  4
         return createdCommentInfo;
 120  
     }
 121  
 
 122  
     /**
 123  
      * This overridden method ...
 124  
      * @see org.kuali.student.core.comment.service.CommentService#addTag(java.lang.String, java.lang.String, org.kuali.student.core.comment.dto.TagInfo)
 125  
      */
 126  
     @Override
 127  
     @Transactional(readOnly=false)
 128  
         public TagInfo addTag(String referenceId, String referenceTypeKey, TagInfo tagInfo) throws DataValidationErrorException, AlreadyExistsException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 129  
 
 130  
         // Validate Tag
 131  4
         List<ValidationResultInfo> validationResults = null;
 132  
         try {
 133  4
             validationResults = validateTag("OBJECT", tagInfo);
 134  0
         } catch (DoesNotExistException e1) {
 135  0
             throw new OperationFailedException("Validation call failed." + e1.getMessage());
 136  4
         }
 137  4
         if (null != validationResults && validationResults.size() > 0) {
 138  0
             throw new DataValidationErrorException("Validation error!", validationResults);
 139  
         }
 140  
         
 141  4
         tagInfo.setReferenceTypeKey(referenceTypeKey);
 142  4
         tagInfo.setReferenceId(referenceId);
 143  4
         Reference reference=null;
 144  4
         reference = commentDao.getReference(referenceId, referenceTypeKey);
 145  4
         if(reference==null){
 146  1
             reference = new Reference();
 147  1
             reference.setReferenceId(referenceId);
 148  
                         try {
 149  1
                                 ReferenceType referenceType = commentDao.fetch(ReferenceType.class, referenceTypeKey);
 150  1
                     reference.setReferenceType(referenceType);
 151  1
                     commentDao.create(reference);
 152  0
                         } catch (DoesNotExistException e) {
 153  0
                                 throw new InvalidParameterException(e.getMessage());
 154  1
                         }
 155  
         }
 156  
 
 157  4
         Tag tag = null;
 158  
 
 159  
         try {
 160  4
             tag = CommentServiceAssembler.toTag(false, tagInfo, commentDao);
 161  0
         } catch (DoesNotExistException e) {
 162  0
             logger.error("Exception occured: ", e);
 163  4
         }
 164  
 
 165  4
         Tag createdTag = commentDao.create(tag);
 166  
 
 167  4
         TagInfo createdTagInfo = CommentServiceAssembler.toTagInfo(createdTag);
 168  
 
 169  4
         return createdTagInfo;
 170  
     }
 171  
 
 172  
     /**
 173  
      * This overridden method ...
 174  
      *
 175  
      * @see org.kuali.student.core.comment.service.CommentService#getComment(java.lang.String)
 176  
      */
 177  
     @Override
 178  
     public CommentInfo getComment(String commentId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 179  8
         checkForMissingParameter(commentId, "commentId");
 180  7
         Comment comment = commentDao.fetch(Comment.class, commentId);
 181  3
         return CommentServiceAssembler.toCommentInfo(comment);
 182  
     }
 183  
 
 184  
     /**
 185  
      * This overridden method ...
 186  
      *
 187  
      * @see org.kuali.student.core.comment.service.CommentService#getCommentTypes()
 188  
      */
 189  
     @Override
 190  
     public List<CommentTypeInfo> getCommentTypes() throws OperationFailedException {
 191  0
         List<CommentType> commentTypes = commentDao.find(CommentType.class);
 192  0
         return CommentServiceAssembler.toCommentTypeInfos(commentTypes);
 193  
     }
 194  
 
 195  
     /**
 196  
      * This overridden method ...
 197  
      *
 198  
      * @see org.kuali.student.core.comment.service.CommentService#getCommentTypesForReferenceType(java.lang.String)
 199  
      */
 200  
     @Override
 201  
     public List<CommentTypeInfo> getCommentTypesForReferenceType(String referenceTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 202  1
         List<CommentType> commentTypes = commentDao.getCommentTypesByReferenceTypeId(referenceTypeKey);
 203  1
         return CommentServiceAssembler.toCommentTypeInfos(commentTypes);
 204  
     }
 205  
 
 206  
     /**
 207  
      * This overridden method ...
 208  
      *
 209  
      * @see org.kuali.student.core.comment.service.CommentService#getComments(java.lang.String, java.lang.String)
 210  
      */
 211  
     @Override
 212  
     public List<CommentInfo> getComments(String referenceId, String referenceTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 213  2
         List<Comment> comments = commentDao.getComments(referenceId, referenceTypeKey);
 214  2
         return CommentServiceAssembler.toCommentInfos(comments);
 215  
     }
 216  
 
 217  
     /**
 218  
      * This overridden method ...
 219  
      *
 220  
      * @see org.kuali.student.core.comment.service.CommentService#getCommentsByType(java.lang.String, java.lang.String, java.lang.String)
 221  
      */
 222  
     @Override
 223  
     public List<CommentInfo> getCommentsByType(String referenceId, String referenceTypeKey, String commentTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 224  0
         List<Comment> comments = commentDao.getCommentsByType(referenceId, referenceTypeKey, commentTypeKey);
 225  0
         return CommentServiceAssembler.toCommentInfos(comments);
 226  
     }
 227  
 
 228  
     /**
 229  
      * This overridden method ...
 230  
      *
 231  
      * @see org.kuali.student.core.comment.service.CommentService#getReferenceTypes()
 232  
      */
 233  
     @Override
 234  
     public List<ReferenceTypeInfo> getReferenceTypes() throws OperationFailedException {
 235  1
             List<ReferenceType> referenceTypes = commentDao.find(ReferenceType.class);
 236  1
         return CommentServiceAssembler.toReferenceTypeInfos(referenceTypes);
 237  
     }
 238  
 
 239  
     /**
 240  
      * This overridden method ...
 241  
      *
 242  
      * @see org.kuali.student.core.comment.service.CommentService#getTag(java.lang.String)
 243  
      */
 244  
     @Override
 245  
     public TagInfo getTag(String tagId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 246  4
         checkForMissingParameter(tagId, "tagId");
 247  3
         Tag tag = commentDao.fetch(Tag.class, tagId);
 248  2
         return CommentServiceAssembler.toTagInfo(tag);
 249  
     }
 250  
 
 251  
     /**
 252  
      * This overridden method ...
 253  
      *
 254  
      * @see org.kuali.student.core.comment.service.CommentService#getTagTypes()
 255  
      */
 256  
     @Override
 257  
     public List<TagTypeInfo> getTagTypes() throws OperationFailedException {
 258  1
         List<TagType> tagTypes = commentDao.find(TagType.class);
 259  
 
 260  1
         return CommentServiceAssembler.toTagTypeInfos(tagTypes);
 261  
     }
 262  
 
 263  
     /**
 264  
      * This overridden method ...
 265  
      *
 266  
      * @see org.kuali.student.core.comment.service.CommentService#getTags(java.lang.String, java.lang.String)
 267  
      */
 268  
     @Override
 269  
     public List<TagInfo> getTags(String referenceId, String referenceTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 270  
 
 271  2
         List<Tag> tags = commentDao.getTags(referenceId, referenceTypeKey);
 272  
 
 273  2
         return CommentServiceAssembler.toTagInfos(tags);
 274  
     }
 275  
 
 276  
     /**
 277  
      * This overridden method ...
 278  
      *
 279  
      * @see org.kuali.student.core.comment.service.CommentService#getTagsByType(java.lang.String, java.lang.String, java.lang.String)
 280  
      */
 281  
     @Override
 282  
     public List<TagInfo> getTagsByType(String referenceId, String referenceTypeKey, String tagTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 283  
 
 284  1
         List<Tag> tags = commentDao.getTagsByType(referenceId, referenceTypeKey, tagTypeKey);
 285  1
         return CommentServiceAssembler.toTagInfos(tags);
 286  
     }
 287  
 
 288  
     /**
 289  
      * This overridden method ...
 290  
      *
 291  
      * @see org.kuali.student.core.comment.service.CommentService#removeComment(java.lang.String, java.lang.String, java.lang.String)
 292  
      */
 293  
     @Override
 294  
     @Transactional(readOnly=false)
 295  
         public StatusInfo removeComment(String commentId, String referenceId, String referenceTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 296  
         try{
 297  2
             checkForMissingParameter(commentId, "commentId");
 298  2
             commentDao.delete(Comment.class, commentId);
 299  1
             return  new StatusInfo();
 300  
         }
 301  0
         catch(MissingParameterException mpe){
 302  0
             Comment comment = null;
 303  
             try{
 304  0
                 comment = commentDao.getComment(referenceId, referenceTypeKey);
 305  0
                 if(comment==null){
 306  0
                     throw new DoesNotExistException();
 307  
                 }
 308  
             }
 309  0
             catch(NoResultException nre){
 310  0
                 throw new DoesNotExistException();
 311  0
             }
 312  0
             commentDao.delete(comment);
 313  0
             return  new StatusInfo();
 314  
         }
 315  
 
 316  
     }
 317  
 
 318  
     /**
 319  
      * This overridden method ...
 320  
      *
 321  
      * @see org.kuali.student.core.comment.service.CommentService#removeComments(java.lang.String)
 322  
      */
 323  
     @Override
 324  
     @Transactional(readOnly=false)
 325  
         public StatusInfo removeComments(String referenceId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 326  1
         List<Comment> comments = commentDao.getCommentsByRefId(referenceId);
 327  1
         for(Comment comment:comments){
 328  2
             commentDao.delete(comment);
 329  
         }
 330  1
         return new StatusInfo();
 331  
     }
 332  
 
 333  
     /**
 334  
      * This overridden method ...
 335  
      * @throws DoesNotExistException
 336  
      *
 337  
      * @see org.kuali.student.core.comment.service.CommentService#removeTag(java.lang.String, java.lang.String, java.lang.String)
 338  
      */
 339  
     @Override
 340  
     @Transactional(readOnly=false)
 341  
         public StatusInfo removeTag(String tagId, String referenceId, String referenceTypeKey) throws  InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DoesNotExistException {
 342  
         try{
 343  3
             checkForMissingParameter(tagId, "tagId");
 344  0
             commentDao.delete(Tag.class, tagId);
 345  0
             return  new StatusInfo();
 346  
         }
 347  3
         catch(MissingParameterException mpe){
 348  3
             Tag tag = null;
 349  
             try{
 350  3
                 tag = commentDao.getTag(referenceId, referenceTypeKey);
 351  1
                 if(tag==null){
 352  0
                     throw new DoesNotExistException();
 353  
                 }
 354  
             }
 355  2
             catch(NoResultException nre){
 356  2
                 throw new DoesNotExistException();
 357  1
             }
 358  1
             commentDao.delete(tag);
 359  1
             return  new StatusInfo();
 360  
         }
 361  
     }
 362  
 
 363  
     /**
 364  
      * This overridden method ...
 365  
      *
 366  
      * @see org.kuali.student.core.comment.service.CommentService#removeTags(java.lang.String)
 367  
      */
 368  
     @Override
 369  
     @Transactional(readOnly=false)
 370  
         public StatusInfo removeTags(String tagId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException {
 371  
         //tagId sould be referenceId like in removeComments() method
 372  1
         List<Tag> tags = commentDao.getTagsByRefId(tagId);
 373  1
         for(Tag tag:tags){
 374  3
             commentDao.delete(tag);
 375  
         }
 376  1
         return new StatusInfo();
 377  
     }
 378  
 
 379  
 
 380  
     /**
 381  
      * This overridden method ...
 382  
      *
 383  
      * @see org.kuali.student.core.comment.service.CommentService#updateComment(java.lang.String, java.lang.String, org.kuali.student.core.comment.dto.CommentInfo)
 384  
      */
 385  
     @Override
 386  
     @Transactional(readOnly=false)
 387  
         public CommentInfo updateComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo) throws DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DoesNotExistException, VersionMismatchException {
 388  
 
 389  
         // Validate Comment
 390  1
         List<ValidationResultInfo> validationResults = validateComment("OBJECT", commentInfo);
 391  1
         if (null != validationResults && validationResults.size() > 0) {
 392  0
             throw new DataValidationErrorException("Validation error!", validationResults);
 393  
         }
 394  
         
 395  1
                 Comment entity = commentDao.fetch(Comment.class, commentInfo.getId());
 396  1
                 if (!String.valueOf(entity.getVersionNumber()).equals(commentInfo.getMetaInfo().getVersionInd())){
 397  0
                         throw new VersionMismatchException("ResultComponent to be updated is not the current version");
 398  
                 }
 399  
 
 400  1
                 CommentServiceAssembler.toComment(entity, referenceId, referenceTypeKey, commentInfo, commentDao);
 401  1
             commentDao.update(entity);
 402  
 
 403  1
             return CommentServiceAssembler.toCommentInfo(entity);
 404  
     }
 405  
 
 406  
     /**
 407  
      * This overridden method ...
 408  
      *
 409  
      * @see org.kuali.student.core.comment.service.CommentService#validateComment(java.lang.String, org.kuali.student.core.comment.dto.CommentInfo)
 410  
      */
 411  
     @Override
 412  
     public List<ValidationResultInfo> validateComment(String validationType, CommentInfo commentInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 413  5
                 checkForMissingParameter(validationType, "validationType");
 414  5
                 checkForMissingParameter(commentInfo, "commentInfo");
 415  
 
 416  5
         ObjectStructureDefinition objStructure = this.getObjectStructure(CommentInfo.class.getName());
 417  5
         Validator defaultValidator = validatorFactory.getValidator();
 418  5
         List<ValidationResultInfo> validationResults = defaultValidator.validateObject(commentInfo, objStructure);
 419  5
         return validationResults;         
 420  
     }
 421  
 
 422  
     private List<ValidationResultInfo> validateTag(String validationType, TagInfo tagInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 423  4
         checkForMissingParameter(validationType, "validationType");
 424  4
         checkForMissingParameter(tagInfo, "tagInfo");
 425  
 
 426  4
         ObjectStructureDefinition objStructure = this.getObjectStructure(TagInfo.class.getName());
 427  4
         Validator defaultValidator = validatorFactory.getValidator();
 428  4
         List<ValidationResultInfo> validationResults = defaultValidator.validateObject(tagInfo, objStructure);
 429  4
         return validationResults;         
 430  
     }
 431  
     
 432  
     /**
 433  
      * @return the commentDao
 434  
      */
 435  
     public CommentDao getCommentDao() {
 436  0
         return commentDao;
 437  
     }
 438  
 
 439  
     /**
 440  
      * @param commentDao the commentDao to set
 441  
      */
 442  
     public void setCommentDao(CommentDao commentDao) {
 443  1
         this.commentDao = commentDao;
 444  1
     }
 445  
 
 446  
     /**
 447  
      * Check for missing parameter and throw localized exception if missing
 448  
      *
 449  
      * @param param
 450  
      * @param parameter name
 451  
      * @throws MissingParameterException
 452  
      */
 453  
     private void checkForMissingParameter(Object param, String paramName)
 454  
             throws MissingParameterException {
 455  35
         if (param == null) {
 456  5
             throw new MissingParameterException(paramName + " can not be null");
 457  
         }
 458  30
     }
 459  
 
 460  
         /**
 461  
          * @return the dictionaryServiceDelegate
 462  
          */
 463  
         public DictionaryService getDictionaryServiceDelegate() {
 464  0
                 return dictionaryServiceDelegate;
 465  
         }
 466  
 
 467  
         /**
 468  
          * @param dictionaryServiceDelegate the dictionaryServiceDelegate to set
 469  
          */
 470  
         public void setDictionaryServiceDelegate(
 471  
                         DictionaryService dictionaryServiceDelegate) {
 472  1
                 this.dictionaryServiceDelegate = dictionaryServiceDelegate;
 473  1
         }
 474  
     /**
 475  
          * @return the searchManager
 476  
          */
 477  
         public SearchManager getSearchManager() {
 478  0
                 return searchManager;
 479  
         }
 480  
 
 481  
         /**
 482  
          * @param searchManager the searchManager to set
 483  
          */
 484  
         public void setSearchManager(SearchManager searchManager) {
 485  1
                 this.searchManager = searchManager;
 486  1
         }
 487  
 
 488  
         @Override
 489  
         public ObjectStructureDefinition getObjectStructure(String objectTypeKey) {
 490  9
                 return dictionaryServiceDelegate.getObjectStructure(objectTypeKey);
 491  
         }
 492  
         @Override
 493  
         public List<String> getObjectTypes() {
 494  0
                 return dictionaryServiceDelegate.getObjectTypes();
 495  
         }
 496  
 
 497  
     /**
 498  
      * @return the validatorFactory
 499  
      */
 500  
     public ValidatorFactory getValidatorFactory() {
 501  0
         return validatorFactory;
 502  
     }
 503  
 
 504  
     /**
 505  
      * @param validatorFactory the validatorFactory to set
 506  
      */
 507  
     public void setValidatorFactory(ValidatorFactory validatorFactory) {
 508  1
         this.validatorFactory = validatorFactory;
 509  1
     }
 510  
 }