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