01: /*
02: * Copyright 2007 Hippo.
03: *
04: * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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 nl.hippo.cms.brokenlinkchecker;
17:
18: /**
19: * <p>
20: * The error message to use for a broken link. It can be a text to be used as is
21: * or a key for localization.
22: * </p>
23: */
24: public class BrokenLinkErrorMessage {
25: /**
26: * <p>
27: * The error message or localization key.
28: * </p>
29: */
30: private String messageOrKey;
31:
32: /**
33: * <p>
34: * Whether or not {@link #messageOrKey} is a text to be used as is. If
35: * <code>true</code> {@link #messageOrKey} is a localization key.
36: * </p>
37: */
38: private boolean isMessageLocalizationKey;
39:
40: /**
41: * <p>
42: * </p>
43: *
44: * @param messageOrKey
45: * the text to be used as is or the localization key.
46: * @param isMessageLocalizationKey
47: * indicates <code>messageOrKey</code> should be used
48: * as is (<code>false</code>), or as a localization
49: * key (<code>true</code>).
50: */
51: public BrokenLinkErrorMessage(String messageOrKey,
52: boolean isMessageLocalizationKey) {
53: super ();
54:
55: this .messageOrKey = messageOrKey;
56: this .isMessageLocalizationKey = isMessageLocalizationKey;
57: }
58:
59: /**
60: * <p>
61: * Get the message or localization key.
62: * </p>
63: *
64: * @return the message or localization key.
65: */
66: public String getMessageOrKey() {
67: return messageOrKey;
68: }
69:
70: /**
71: * <p>
72: * Determine how to use the message or key.
73: * </p>
74: *
75: * @return <code>true</code> if the value should be used as a
76: * localization key, <code>false</code> otherwise.
77: */
78: public boolean isMessageLocalizationKey() {
79: return isMessageLocalizationKey;
80: }
81: }
|