Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TransactionalDocumentBase |
|
| 1.3333333333333333;1.333 |
1 | /* | |
2 | * Copyright 2005-2007 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.kns.document; | |
17 | ||
18 | import org.kuali.rice.kns.service.KNSServiceLocator; | |
19 | import org.kuali.rice.kns.service.KNSServiceLocatorWeb; | |
20 | ||
21 | import javax.persistence.MappedSuperclass; | |
22 | ||
23 | /** | |
24 | * This is the base class implementation for all transaction processing eDocs. | |
25 | */ | |
26 | @MappedSuperclass | |
27 | public abstract class TransactionalDocumentBase extends DocumentBase implements TransactionalDocument, SessionDocument { | |
28 | 0 | private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(TransactionalDocumentBase.class); |
29 | ||
30 | /** | |
31 | * Default constructor. | |
32 | */ | |
33 | public TransactionalDocumentBase() { | |
34 | 0 | super(); |
35 | 0 | } |
36 | ||
37 | /** | |
38 | * @see org.kuali.rice.kns.document.TransactionalDocument#getAllowsCopy() | |
39 | * Checks if copy is set to true in data dictionary and the document instance implements | |
40 | * Copyable. | |
41 | */ | |
42 | public boolean getAllowsCopy() { | |
43 | 0 | return KNSServiceLocatorWeb.getTransactionalDocumentDictionaryService().getAllowsCopy(this).booleanValue() && this instanceof Copyable; |
44 | } | |
45 | ||
46 | /** | |
47 | * | |
48 | * This method to check whether the document class implements SessionDocument | |
49 | * | |
50 | * @return | |
51 | */ | |
52 | public boolean isSessionDocument() { | |
53 | 0 | return SessionDocument.class.isAssignableFrom(this.getClass()); |
54 | } | |
55 | ||
56 | ||
57 | } |