KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > utils > xml > DescriptionGroupDesc


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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): Philippe Coq
22  * --------------------------------------------------------------------------
23  * $Id: DescriptionGroupDesc.java,v 1.1 2003/10/30 09:42:25 coqp Exp $
24  * --------------------------------------------------------------------------
25  */

26
27
28 package com.bull.eclipse.jonas.utils.xml;
29
30 // SAX imports
31
import org.xml.sax.SAXParseException JavaDoc;
32
33
34 /**
35  * This class is used to keep the usage of the contained description related
36  * elements consistent acoross J2EE deployment descriptors.
37  * Elements are "description", "display-name", "icon"
38  * used by application, connector, ejb-jar, webservices.
39  *
40  * @author Philippe Coq
41  *
42  */

43
44 public abstract class DescriptionGroupDesc implements DescriptionGroup {
45
46     /**
47      * The description field
48      */

49     protected String JavaDoc description = null;
50
51     /**
52      * The displayName field
53      */

54     protected String JavaDoc displayName = null;
55
56     /**
57      * The small-icon field
58      */

59     protected String JavaDoc smallIcon = null;
60
61     /**
62      * The large-icon field
63      */

64     protected String JavaDoc largeIcon = null;
65
66     /**
67      * Get the display name of the deployment descriptor.
68      * @return the display name of the deployment descriptor.
69      */

70     public String JavaDoc getDisplayName() {
71         return displayName;
72     }
73
74     /**
75      * Get the description of the deployment descriptor.
76      * @return the description of the deployment descriptor.
77      */

78     public String JavaDoc getDescription() {
79         return description;
80     }
81
82     /**
83      * Get the small-icon of the deployment descriptor.
84      * @return the small-icon of the deployment descriptor.
85      */

86     public String JavaDoc getSmallIcon() {
87         return smallIcon;
88     }
89
90     /**
91      * Get the large-icon of the deployment descriptor.
92      * @return the large-icon of the deployment descriptor.
93      */

94     public String JavaDoc getLargeIcon() {
95         return largeIcon;
96     }
97
98     /**
99      * Return a String representation of the DeploymentDesc.
100      * @return a String representation of the DeploymentDesc.
101      */

102     public abstract String JavaDoc toString();
103
104     /**
105      * build a message from SAX Exception in a consistent style, consistent
106      * with emacs compile mode (same as grep, cc, javac, etc).
107      * @param fileName name of the file
108      * @param exception the SAX exception
109      * @param msg the string message
110      * @return a message which is in a consistent style
111      */

112     protected static String JavaDoc getSAXMsg(String JavaDoc fileName,
113                                        SAXParseException JavaDoc exception, String JavaDoc msg) {
114         String JavaDoc ret = fileName + ":" + exception.getLineNumber() + ":"
115             + exception.getColumnNumber() + ": ";
116         ret += msg;
117         return ret;
118     }
119
120 }
121
Popular Tags