001 /**
002 *
003 * Copyright 2003-2004 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 //
019 // This source code implements specifications defined by the Java
020 // Community Process. In order to remain compliant with the specification
021 // DO NOT add / change / or delete method signatures!
022 //
023
024 package javax.enterprise.deploy.model;
025
026 /**
027 * An interface for beans that represent a fragment of a standard deployment
028 * descriptor. A link is provided to the J2EE application that includes this bean.
029 *
030 * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
031 */
032 public interface DDBean {
033 /**
034 * Returns the location in the deployment descriptor from which this bean is derived.
035 *
036 * @return The XPath of this Bean.
037 */
038 public String getXpath();
039
040 /**
041 * Returns the XML text for by this bean.
042 *
043 * @return The XML text for this Bean.
044 */
045 public String getText();
046
047 /**
048 * Returns the ATTLIST ID value for the XML tag defined by the Xpath for this bean.
049 *
050 * @return The XML text for this Bean or 'null' if no attribute was specifed with the tag.
051 */
052 public String getId();
053
054 /**
055 * Return the root element for this DDBean.
056 *
057 * @return The DDBeanRoot at the root of this DDBean tree.
058 */
059 public DDBeanRoot getRoot();
060
061 /**
062 * Return a list of DDBeans based upon the XPath.
063 *
064 * @param xpath An XPath string referring to a location in the same deployment descriptor as this standard bean.
065 *
066 * @return a list of DDBeans or 'null' if no matching XML data is found.
067 */
068 public DDBean[] getChildBean(String xpath);
069
070 /**
071 * Return a list of text values for a given XPath in the deployment descriptor.
072 *
073 * @param xpath An XPath.
074 *
075 * @return The list text values for this XPath or 'null' if no matching XML data is found.
076 */
077 public String[] getText(String xpath);
078
079 /**
080 * Register a listener for a specific XPath.
081 *
082 * @param xpath The XPath this listener is to be registered for.
083 * @param xpl The listener object.
084 */
085 public void addXpathListener(String xpath, XpathListener xpl);
086
087 /**
088 * Unregister a listener for a specific XPath.
089 *
090 * @param xpath The XPath this listener is to be registered for.
091 * @param xpl The listener object.
092 */
093 public void removeXpathListener(String xpath, XpathListener xpl);
094
095 /**
096 * Returns the list of attribute names associated with XML element.
097 *
098 * @since 1.1
099 *
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 }