View Javadoc

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  package org.kuali.rice.kew.api.action;
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.kuali.rice.core.api.CoreConstants;
28  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
29  import org.w3c.dom.Element;
30  
31  @XmlRootElement(name = RequestedActions.Constants.ROOT_ELEMENT_NAME)
32  @XmlAccessorType(XmlAccessType.NONE)
33  @XmlType(name = RequestedActions.Constants.TYPE_NAME, propOrder = {
34  		RequestedActions.Elements.COMPLETE_REQUESTED,
35  		RequestedActions.Elements.APPROVE_REQUESTED,
36  		RequestedActions.Elements.ACKNOWLEDGE_REQUESTED,
37  		RequestedActions.Elements.FYI_REQUESTED,
38  		CoreConstants.CommonElements.FUTURE_ELEMENTS
39  })
40  public final class RequestedActions extends AbstractDataTransferObject {
41      
42  	private static final long serialVersionUID = -6600754341497697330L;
43  
44      @XmlElement(name = Elements.COMPLETE_REQUESTED, required = true)
45      private final boolean completeRequested;
46  	
47  	@XmlElement(name = Elements.APPROVE_REQUESTED, required = true)
48      private final boolean approveRequested;
49  	
50  	@XmlElement(name = Elements.ACKNOWLEDGE_REQUESTED, required = true)
51  	private final boolean acknowledgeRequested;
52  	
53  	@XmlElement(name = Elements.FYI_REQUESTED, required = true)
54  	private final boolean fyiRequested;
55      
56      @SuppressWarnings("unused")
57      @XmlAnyElement
58      private final Collection<Element> _futureElements = null;
59  
60      private RequestedActions() {
61      	this.completeRequested = false;
62      	this.approveRequested = false;
63      	this.acknowledgeRequested = false;
64      	this.fyiRequested = false;
65      }
66      
67      private RequestedActions(boolean completeRequested, boolean approveRequested, boolean acknowledgeRequested, boolean fyiRequested) {
68      	this.completeRequested = completeRequested;
69      	this.approveRequested = approveRequested;
70      	this.acknowledgeRequested = acknowledgeRequested;
71      	this.fyiRequested = fyiRequested;
72      }
73      
74      public static RequestedActions create(boolean completeRequested, boolean approveRequested, boolean acknowledgeRequested, boolean fyiRequested) {
75      	return new RequestedActions(completeRequested, approveRequested, acknowledgeRequested, fyiRequested);
76      }
77      
78  	public boolean isCompleteRequested() {
79  		return completeRequested;
80  	}
81  
82  	public boolean isApproveRequested() {
83  		return approveRequested;
84  	}
85  
86  	public boolean isAcknowledgeRequested() {
87  		return acknowledgeRequested;
88  	}
89  
90  	public boolean isFyiRequested() {
91  		return fyiRequested;
92      }
93      
94      /**
95       * Defines some internal constants used on this class.
96       */
97      static class Constants {
98          final static String ROOT_ELEMENT_NAME = "requestedActions";
99          final static String TYPE_NAME = "RequestedActionsType";
100     }
101     
102     /**
103      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
104      */
105     static class Elements {
106         final static String COMPLETE_REQUESTED = "completeRequested";
107         final static String APPROVE_REQUESTED = "approveRequested";
108         final static String ACKNOWLEDGE_REQUESTED = "acknowledgeRequested";
109         final static String FYI_REQUESTED = "fyiRequested";
110     }
111 
112 }