01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.core.document.authorization;
17:
18: /**
19: * TransactionalDocument-specific flags used for authorization checks.
20: */
21: final public class TransactionalDocumentActionFlags extends
22: DocumentActionFlags {
23: private boolean canErrorCorrect;
24:
25: /**
26: * Default constructor.
27: */
28: public TransactionalDocumentActionFlags() {
29: }
30:
31: /**
32: * Handles constructing a TransactionalDocumentActionFlags object instance from another DocumentActionFlags instance.
33: *
34: * @param flags
35: */
36: public TransactionalDocumentActionFlags(DocumentActionFlags flags) {
37: super (flags);
38:
39: if (flags instanceof TransactionalDocumentActionFlags) {
40: TransactionalDocumentActionFlags tflags = (TransactionalDocumentActionFlags) flags;
41:
42: this .canErrorCorrect = tflags.canErrorCorrect;
43: }
44: }
45:
46: /**
47: * @return boolean
48: */
49: public boolean getCanErrorCorrect() {
50: return canErrorCorrect;
51: }
52:
53: /**
54: * @param canErrorCorrect
55: */
56: public void setCanErrorCorrect(boolean canErrorCorrect) {
57: this .canErrorCorrect = canErrorCorrect;
58: }
59:
60: /**
61: * Debugging method, simplifies comparing another instance of this class to this one
62: *
63: * @param other
64: * @return String
65: */
66: public String diff(DocumentActionFlags other) {
67: StringBuffer s = new StringBuffer(super .diff(other));
68:
69: if (other instanceof TransactionalDocumentActionFlags) {
70: TransactionalDocumentActionFlags tother = (TransactionalDocumentActionFlags) other;
71:
72: if (canErrorCorrect != tother.canErrorCorrect) {
73: s.append("canErrorCorrect=(" + canErrorCorrect + ","
74: + tother.canErrorCorrect + ")");
75: }
76: }
77:
78: return s.toString();
79: }
80: }
|