Source Code Cross Referenced for DeploymentDescModifier.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_ws » wsgen » ddmodifier » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas_ws.wsgen.ddmodifier 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS : Java(TM) OpenSource Application Server
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2.1 of the License, or any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
017:         * USA
018:         *
019:         * Initial Developer : Guillaume Sauthier
020:         * --------------------------------------------------------------------------
021:         * $Id: DeploymentDescModifier.java 7057 2005-07-18 23:53:31Z mwringe $
022:         * --------------------------------------------------------------------------
023:         */package org.objectweb.jonas_ws.wsgen.ddmodifier;
024:
025:        import org.w3c.dom.Document;
026:        import org.w3c.dom.Element;
027:        import org.w3c.dom.Text;
028:
029:        import org.objectweb.jonas.common.Log;
030:
031:        import org.objectweb.util.monolog.api.Logger;
032:
033:        /**
034:         * Modify an Element from a Deployment Descriptor. Contains XML commons
035:         * utilities.
036:         *
037:         * @author Guillaume Sauthier
038:         */
039:        public class DeploymentDescModifier {
040:
041:            /** J2EE Default XML namespace */
042:            protected static final String J2EE_NS = "http://java.sun.com/xml/ns/j2ee";
043:
044:            /** JOnAS Default XML namespace */
045:            protected static final String JONAS_NS = "http://www.objectweb.org/jonas/ns";
046:
047:            /** logger */
048:            private static Logger logger = Log
049:                    .getLogger(Log.JONAS_WSGEN_PREFIX);
050:
051:            /** base element */
052:            private Element element;
053:
054:            /** parent element */
055:            private Element parent;
056:
057:            /** base document */
058:            private Document doc;
059:
060:            /**
061:             * Create a new DeploymentDescModifier to update the given Element.
062:             *
063:             * @param element XML element to be modified.
064:             * @param doc base document for Element creation.
065:             */
066:            public DeploymentDescModifier(Element element, Document doc) {
067:                this (element, doc, null);
068:            }
069:
070:            /**
071:             * Create a new DeploymentDescModifier to update the given Element.
072:             *
073:             * @param element XML element to be modified.
074:             * @param doc base document for Element creation.
075:             * @param parent parent Element, used if element is null
076:             */
077:            public DeploymentDescModifier(Element element, Document doc,
078:                    Element parent) {
079:                this .element = element;
080:                this .doc = doc;
081:                this .parent = parent;
082:            }
083:
084:            /**
085:             * Create a new Element with given name in J2EE XML namespace.
086:             *
087:             * @param name Element name
088:             *
089:             * @return the created Element
090:             */
091:            protected Element newJ2EEElement(String name) {
092:                return doc.createElementNS(J2EE_NS, name);
093:            }
094:
095:            /**
096:             * Create a new Element with given name in J2EE XML namespace with an inner
097:             * Text Node.
098:             *
099:             * @param name Element name
100:             * @param text Element content
101:             *
102:             * @return the created Element
103:             */
104:            protected Element newJ2EEElement(String name, String text) {
105:                Element e = doc.createElementNS(J2EE_NS, name);
106:                Text txt = doc.createTextNode(text);
107:                e.appendChild(txt);
108:
109:                return e;
110:            }
111:
112:            /**
113:             * Create a new Element with given name in JOnAS XML namespace.
114:             *
115:             * @param name Element name
116:             *
117:             * @return the created Element
118:             */
119:            protected Element newJOnASElement(String name) {
120:                return doc.createElementNS(JONAS_NS, name);
121:            }
122:
123:            /**
124:             * Create a new Element with given name in JOnAS XML namespace, with an
125:             * inner Text Node.
126:             *
127:             * @param name Element name
128:             * @param text node's text
129:             *
130:             * @return the created Element
131:             */
132:            protected Element newJOnASElement(String name, String text) {
133:                Element e = doc.createElementNS(JONAS_NS, name);
134:                Text txt = doc.createTextNode(text);
135:                e.appendChild(txt);
136:
137:                return e;
138:            }
139:
140:            /**
141:             * Create a new Element with given name
142:             *
143:             * @param name Element name
144:             * @return the created Element
145:             */
146:            protected Element newElement(String name) {
147:                return doc.createElement(name);
148:            }
149:
150:            /**
151:             * Create a new Element with an inner Text Node.
152:             *
153:             * @param name Element name
154:             * @param text node's text
155:             *
156:             * @return the created Element
157:             */
158:            protected Element newElement(String name, String text) {
159:                Element e = doc.createElement(name);
160:                Text txt = doc.createTextNode(text);
161:                e.appendChild(txt);
162:
163:                return e;
164:            }
165:
166:            /**
167:             * @return Returns the logger.
168:             */
169:            public static Logger getLogger() {
170:                return logger;
171:            }
172:
173:            /**
174:             * @return Returns the parent (can be null).
175:             */
176:            public Element getParent() {
177:                return parent;
178:            }
179:
180:            /**
181:             * @return Returns the element.
182:             */
183:            public Element getElement() {
184:                return element;
185:            }
186:
187:            /**
188:             * @return Returns the document.
189:             */
190:            public Document getDocument() {
191:                return doc;
192:            }
193:
194:            /**
195:             * Set the new document to use
196:             * @param doc the new document to use
197:             */
198:            public void setDocument(Document doc) {
199:                this .doc = doc;
200:                this .parent = doc.getDocumentElement();
201:            }
202:
203:            /**
204:             * Set the new base Element to use
205:             * @param e the new base Element to use
206:             */
207:            public void setElement(Element e) {
208:                element = e;
209:                getParent().appendChild(e);
210:            }
211:
212:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.