01: /*
02: * Copyright 2005-2006 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:
17: package org.kuali.core.datadictionary;
18:
19: import org.apache.commons.logging.Log;
20: import org.apache.commons.logging.LogFactory;
21:
22: /**
23: * Common base class for DataDictionaryDefinition types.
24: *
25: *
26: */
27: abstract public class DataDictionaryDefinitionBase implements
28: DataDictionaryDefinition {
29: private static Log LOG = LogFactory
30: .getLog(DataDictionaryDefinitionBase.class);
31:
32: private final String parseLocation;
33:
34: // this boolean is for the dd generator, since it does not parse dd files
35: public static boolean isParsingFile = true;
36:
37: public DataDictionaryDefinitionBase() {
38: if (isParsingFile) {
39: String parseFileName = DataDictionaryBuilder
40: .getCurrentFileName();
41: int parseLineNumber = DataDictionaryBuilder
42: .getCurrentLineNumber();
43:
44: if (parseFileName != null) {
45: parseLocation = parseFileName + ":"
46: + Integer.toString(parseLineNumber);
47: } else {
48: parseLocation = "";
49: }
50: } else {
51: parseLocation = "";
52: }
53: }
54:
55: /**
56: * @return XML filename and line number from the parser which created this object
57: */
58: protected String getParseLocation() {
59: return parseLocation;
60: }
61: }
|