Coverage Report - org.kuali.rice.kew.api.document.WorkflowAttributeValidationError
 
Classes in this File Line Coverage Branch Coverage Complexity
WorkflowAttributeValidationError
0%
0/16
0%
0/4
1.8
WorkflowAttributeValidationError$Constants
0%
0/1
N/A
1.8
WorkflowAttributeValidationError$Elements
0%
0/1
N/A
1.8
 
 1  
 /*
 2  
  * Copyright 2005-2009, 2011 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.api.document;
 17  
 
 18  
 import java.util.Collection;
 19  
 
 20  
 import javax.xml.bind.annotation.XmlAccessType;
 21  
 import javax.xml.bind.annotation.XmlAccessorType;
 22  
 import javax.xml.bind.annotation.XmlAnyElement;
 23  
 import javax.xml.bind.annotation.XmlElement;
 24  
 import javax.xml.bind.annotation.XmlRootElement;
 25  
 import javax.xml.bind.annotation.XmlType;
 26  
 
 27  
 import org.apache.commons.lang.StringUtils;
 28  
 import org.kuali.rice.core.api.CoreConstants;
 29  
 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
 30  
 import org.w3c.dom.Element;
 31  
 
 32  
 /**
 33  
  * TODO...
 34  
  */
 35  
 @XmlRootElement(name = WorkflowAttributeValidationError.Constants.ROOT_ELEMENT_NAME)
 36  
 @XmlAccessorType(XmlAccessType.NONE)
 37  
 @XmlType(name = WorkflowAttributeValidationError.Constants.TYPE_NAME, propOrder = {
 38  
         WorkflowAttributeValidationError.Elements.KEY,
 39  
         WorkflowAttributeValidationError.Elements.MESSAGE,
 40  
         CoreConstants.CommonElements.FUTURE_ELEMENTS
 41  
 })
 42  
 public final class WorkflowAttributeValidationError extends AbstractDataTransferObject {
 43  
 
 44  
     private static final long serialVersionUID = 3323649177455266977L;
 45  
 
 46  
     @XmlElement(name = Elements.KEY, required = true)
 47  
     private final String key;
 48  
     
 49  
     @XmlElement(name = Elements.MESSAGE, required = true)
 50  
     private final String message;
 51  
     
 52  0
     @SuppressWarnings("unused")
 53  
     @XmlAnyElement
 54  
     private final Collection<Element> _futureElements = null;
 55  
 
 56  
     /**
 57  
      * Private constructor used only by JAXB.
 58  
      */
 59  0
     public WorkflowAttributeValidationError() {
 60  0
             this.key = null;
 61  0
             this.message = null;
 62  0
     }
 63  
     
 64  0
     private WorkflowAttributeValidationError(String key, String message) {
 65  0
         if (StringUtils.isBlank(key)) {
 66  0
             throw new IllegalArgumentException("key was null or blank");
 67  
         }
 68  0
         if (StringUtils.isBlank(message)) {
 69  0
             throw new IllegalArgumentException("message was null or blank");
 70  
         }
 71  0
         this.key = key;
 72  0
         this.message = message;
 73  0
     }
 74  
     
 75  
     public static WorkflowAttributeValidationError create(String key, String message) {
 76  0
         return new WorkflowAttributeValidationError(key, message);
 77  
     }
 78  
     
 79  
     public String getKey() {
 80  0
         return key;
 81  
     }
 82  
 
 83  
     public String getMessage() {
 84  0
         return message;
 85  
     }
 86  
 
 87  
     /**
 88  
      * Defines some internal constants used on this class.
 89  
      */
 90  0
     static class Constants {
 91  
         final static String ROOT_ELEMENT_NAME = "workflowAttributeValidationError";
 92  
         final static String TYPE_NAME = "WorkflowAttributeValidationErrorType";
 93  
     }
 94  
 
 95  
     /**
 96  
      * A private class which exposes constants which define the XML element names to use when this
 97  
      * object is marshalled to XML.
 98  
      */
 99  0
     static class Elements {
 100  
         final static String KEY = "key";
 101  
         final static String MESSAGE = "message";
 102  
     }
 103  
 
 104  
     
 105  
 }