01: /*
02: * ========================================================================
03: *
04: * Copyright 2003-2005 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: * ========================================================================
19: */
20: package org.apache.cactus.integration.ant.deployment.application;
21:
22: import java.util.Iterator;
23:
24: import org.w3c.dom.Document;
25: import org.w3c.dom.Element;
26:
27: /**
28: * Encapsulates the DOM representation of an EAR descriptor
29: * (<code>application.xml</code>) to provide convenience methods for easy
30: * access and manipulation.
31: *
32: * @since Cactus 1.5
33: * @version $Id: ApplicationXml.java 239141 2005-02-15 10:31:44Z vmassol $
34: */
35: public interface ApplicationXml {
36: /**
37: * Returns the DOM document representing the deployment descriptor. The
38: * document will contain any modifications made through this instance.
39: *
40: * @return The document representing the deploy descriptor
41: */
42: Document getDocument();
43:
44: /**
45: * Returns the J2EE API version.
46: *
47: * @return The version
48: */
49: ApplicationXmlVersion getVersion();
50:
51: /**
52: * Returns the element that contains the definition of a specific web
53: * module, or <code>null</code> if a web module with the specified web-uri
54: * is not defined.
55: *
56: * @param theWebUri The uri of the web module
57: * @return The DOM element representing the web module definition
58: */
59: Element getWebModule(String theWebUri);
60:
61: /**
62: * Returns the context root of the the specified web module.
63: *
64: * @param theWebUri The uri of the web module
65: * @return The context root of the web module
66: */
67: String getWebModuleContextRoot(String theWebUri);
68:
69: /**
70: * Returns an iterator over the URIs of the web modules defined in the
71: * descriptor.
72: *
73: * @return An iterator over the URIs of the web modules
74: */
75: Iterator getWebModuleUris();
76:
77: /**
78: * Returns an iterator over the elements that match the specified tag.
79: *
80: * @param theTag The descriptor tag of which the elements should be
81: * returned
82: * @return An iterator over the elements matching the tag, in the order
83: * they occur in the descriptor
84: */
85: Iterator getElements(ApplicationXmlTag theTag);
86:
87: /**
88: * Adds a web module to the deployment descriptor
89: *
90: * @param theUri the uri of the new module
91: * @param theContext the context of the new module
92: */
93: void addWebModule(String theUri, String theContext);
94: }
|