01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer(s): Ludovic BERT & Florent BENOIT
22: * --------------------------------------------------------------------------
23: * $Id: AbsDeploymentDesc.java 4729 2004-05-11 08:07:50Z sauthieg $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas_lib.deployment.api;
26:
27: // SAX imports
28: import org.xml.sax.SAXParseException;
29:
30: /**
31: * This class provides an abstract implementation of the
32: * DeploymentDescriptor interface of JOnAS
33: * @author Ludovic Bert
34: * @author Florent Benoit
35: */
36:
37: public abstract class AbsDeploymentDesc implements DeploymentDesc {
38:
39: /**
40: * The displayName field
41: */
42: protected String displayName = null;
43:
44: /**
45: * Get the display name of the deployment descriptor.
46: * @return the display name of the deployment descriptor.
47: */
48: public String getDisplayName() {
49: return displayName;
50: }
51:
52: /**
53: * Return a String representation of the DeploymentDesc.
54: * @return a String representation of the DeploymentDesc.
55: */
56: public abstract String toString();
57:
58: /**
59: * build a message from SAX Exception in a consistent style, consistent
60: * with emacs compile mode (same as grep, cc, javac, etc).
61: * @param fileName name of the file
62: * @param exception the SAX exception
63: * @param msg the string message
64: * @return a message which is in a consistent style
65: */
66: protected static String getSAXMsg(String fileName,
67: SAXParseException exception, String msg) {
68: String ret = fileName + ":" + exception.getLineNumber() + ":"
69: + exception.getColumnNumber() + ": ";
70: ret += msg;
71: return ret;
72: }
73:
74: }
|