1 /**
2 *
3 * Copyright 2003-2004 The Apache Software Foundation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
19
20
21
22
23
24 package javax.enterprise.deploy.model;
25
26 /**
27 * An interface for beans that represent a fragment of a standard deployment
28 * descriptor. A link is provided to the J2EE application that includes this bean.
29 *
30 * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
31 */
32 public interface DDBean {
33 /**
34 * Returns the location in the deployment descriptor from which this bean is derived.
35 *
36 * @return The XPath of this Bean.
37 */
38 public String getXpath();
39
40 /**
41 * Returns the XML text for by this bean.
42 *
43 * @return The XML text for this Bean.
44 */
45 public String getText();
46
47 /**
48 * Returns the ATTLIST ID value for the XML tag defined by the Xpath for this bean.
49 *
50 * @return The XML text for this Bean or 'null' if no attribute was specifed with the tag.
51 */
52 public String getId();
53
54 /**
55 * Return the root element for this DDBean.
56 *
57 * @return The DDBeanRoot at the root of this DDBean tree.
58 */
59 public DDBeanRoot getRoot();
60
61 /**
62 * Return a list of DDBeans based upon the XPath.
63 *
64 * @param xpath An XPath string referring to a location in the same deployment descriptor as this standard bean.
65 *
66 * @return a list of DDBeans or 'null' if no matching XML data is found.
67 */
68 public DDBean[] getChildBean(String xpath);
69
70 /**
71 * Return a list of text values for a given XPath in the deployment descriptor.
72 *
73 * @param xpath An XPath.
74 *
75 * @return The list text values for this XPath or 'null' if no matching XML data is found.
76 */
77 public String[] getText(String xpath);
78
79 /**
80 * Register a listener for a specific XPath.
81 *
82 * @param xpath The XPath this listener is to be registered for.
83 * @param xpl The listener object.
84 */
85 public void addXpathListener(String xpath, XpathListener xpl);
86
87 /**
88 * Unregister a listener for a specific XPath.
89 *
90 * @param xpath The XPath this listener is to be registered for.
91 * @param xpl The listener object.
92 */
93 public void removeXpathListener(String xpath, XpathListener xpl);
94
95 /**
96 * Returns the list of attribute names associated with XML element.
97 *
98 * @since 1.1
99 *
100 * @return a list of attribute names on this element. Null
101 * is returned if there are no attributes.
102 */
103 public String[] getAttributeNames();
104
105 /**
106 * Returns the string value of the named attribute.
107 *
108 * @since 1.1
109 *
110 * @return the value of the attribute. Null is returned
111 * if there is no such attribute.
112 */
113 public String getAttributeValue(String attrName);
114 }