Coverage Report - org.kuali.rice.kew.exception.InvalidParentDocTypeException
 
Classes in this File Line Coverage Branch Coverage Complexity
InvalidParentDocTypeException
0%
0/18
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007-2009 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kew.exception;
 17  
 
 18  
 import org.kuali.rice.core.xml.XmlException;
 19  
 
 20  
 /**
 21  
  * This error is thrown whenever a child document type is trying to be processed before its 
 22  
  * parent document type has been parsed; this provides a means for delaying the processing
 23  
  * of child doc types until their parents are parsed.
 24  
  * 
 25  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 26  
  *
 27  
  */
 28  
 public class InvalidParentDocTypeException extends XmlException {
 29  
         
 30  
         /** The name of the parent document that still needs to be parsed. */
 31  
         private final String parentName;
 32  
         /** The name of the child document that was expecting the parentName document to exist. */
 33  
         private final String childName;
 34  
         
 35  
         /**
 36  
          * Constructs an InvalidParentDocTypeException, given a document type parent name and a child name.
 37  
          * 
 38  
          * @param docParent The name of the unprocessed document type parent.
 39  
          * @param docChild The name of the unprocessed document type child.
 40  
          */
 41  
         public InvalidParentDocTypeException(String docParent, String docChild) {
 42  0
                 super("parent: " + docParent + " child: " + docChild);
 43  0
                 parentName = docParent;
 44  0
                 childName = docChild;
 45  0
         }
 46  
         
 47  
         /**
 48  
          * Constructs an InvalidParentDocTypeException, given a document type parent name, a child name, and an error message.
 49  
          * 
 50  
          * @param docParent The name of the unprocessed document type parent.
 51  
          * @param docChild The name of the unprocessed document type child.
 52  
          * @param message The error message.
 53  
          */
 54  
         public InvalidParentDocTypeException(String docParent, String docChild, String message) {
 55  0
                 super(message);
 56  0
                 parentName = docParent;
 57  0
                 childName = docChild;
 58  0
         }
 59  
 
 60  
         /**
 61  
          * Constructs an InvalidParentDocTypeException, given a document type parent name, a child name, an error message, and a cause.
 62  
          * 
 63  
          * @param docParent The name of the unprocessed document type parent.
 64  
          * @param docChild The name of the unprocessed document type child.
 65  
          * @param message The error message.
 66  
          * @param throwable The cause.
 67  
          */
 68  
         public InvalidParentDocTypeException(String docParent, String docChild, String message, Throwable throwable) {
 69  0
                 super(message, throwable);
 70  0
                 parentName = docParent;
 71  0
                 childName = docChild;
 72  0
         }
 73  
 
 74  
         /**
 75  
          * Constructs an InvalidParentDocTypeException, given a document type parent name, a child name, and a cause.
 76  
          * 
 77  
          * @param docParent The name of the unprocessed document type parent.
 78  
          * @param docChild The name of the unprocessed document type child.
 79  
          * @param throwable The cause.
 80  
          */
 81  
         public InvalidParentDocTypeException(String docParent, String docChild, Throwable throwable) {
 82  0
                 super(throwable);
 83  0
                 parentName = docParent;
 84  0
                 childName = docChild;
 85  0
         }
 86  
         
 87  
         /**
 88  
          * Retrieves the name of the parent document type that has not been processed yet.
 89  
          * 
 90  
          * @return The name of the unprocessed document type parent, which may or may not be null.
 91  
          */
 92  
         public String getParentName() {
 93  0
                 return parentName;
 94  
         }
 95  
         
 96  
         /**
 97  
          * Retrieves the name of the child document type that depends on the given parent.
 98  
          * 
 99  
          * @return The name of the unprocessed document type child, which may or may not be null.
 100  
          */
 101  
         public String getChildName() {
 102  0
                 return childName;
 103  
         }
 104  
 }