KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > enterprise > deploy > model > DDBean


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package javax.enterprise.deploy.model;
25
26 /**
27  * An interface for beans that represent a fragment of a
28  * standard deployment descriptor. A link is provided to
29  * the J2EE application that includes this bean.
30  */

31 public interface DDBean
32 {
33     
34     /**
35      * Returns the original xpath string provided by the DConfigBean.
36      * @return The XPath of this Bean.
37      */

38     public String JavaDoc getXpath();
39     
40     /**
41      * Returns the XML text for by this bean.
42      * @return The XML text for this Bean.
43      */

44     public String JavaDoc getText();
45
46     /**
47      * Returns a tool-specific reference for attribute ID on an
48      * element in the deployment descriptor. This attribute is
49      * defined for J2EE 1.2 and 1.3 components.
50      * @return The XML text for this Bean or 'null' if
51      * no attribute was specifed with the tag.
52      */

53     public String JavaDoc getId();
54    
55    /**
56     * Return the root element for this DDBean.
57     * @return The DDBeanRoot at the root of this DDBean
58     * tree.
59     */

60    public DDBeanRoot JavaDoc getRoot();
61       
62    /**
63     * Return a list of DDBeans based upon the XPath.
64     * @param xpath An XPath string referring to a location in the
65     * same deployment descriptor as this standard bean.
66     * @return a list of DDBeans or 'null' if no matching XML data is
67     * found.
68     */

69    public DDBean JavaDoc[] getChildBean(String JavaDoc xpath);
70    
71    /**
72     * Return a list of text values for a given XPath in the
73     * deployment descriptor.
74     * @param xpath An XPath.
75     * @return The list text values for this XPath or 'null'
76     * if no matching XML data is found.
77     */

78    public String JavaDoc[] getText(String JavaDoc xpath);
79    
80    /**
81     * Register a listener for a specific XPath.
82     *
83     * @param xpath The XPath this listener is to be registered for.
84     * @param xpl The listener object.
85     */

86    public void addXpathListener(String JavaDoc xpath, XpathListener JavaDoc xpl);
87
88    /**
89     * Unregister a listener for a specific XPath.
90     *
91     * @param xpath The XPath from which this listener is to be
92     * unregistered.
93     * @param xpl The listener object.
94     */

95    public void removeXpathListener(String JavaDoc xpath, XpathListener JavaDoc xpl);
96
97     /**
98      * Returns the list of attribute names associated with the XML element.
99      *
100      * @return a list of attribute names on this element. Null
101      * is returned if there are no attributes.
102      */

103    public String JavaDoc[] getAttributeNames();
104
105     /**
106      * Returns the string value of the named attribute.
107      *
108      * @return a the value of the attribute. Null is returned
109      * if there is no such attribute.
110      */

111    public String JavaDoc getAttributeValue(String JavaDoc attrName);
112 }
113
114
Popular Tags