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