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 import javax.enterprise.deploy.shared.ModuleType; 027 028 /** 029 * An interface that represents the root of a standard deployment descriptor. 030 * A DDBeanRoot is a type of DDBean. 031 * 032 * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $ 033 */ 034 public interface DDBeanRoot extends DDBean { 035 /** 036 * Return the ModuleType of deployment descriptor. 037 * 038 * @return The ModuleType of deployment descriptor 039 */ 040 public ModuleType getType(); 041 042 /** 043 * Return the containing DeployableObject 044 * 045 * @return The DeployableObject that contains this deployment descriptor 046 */ 047 public DeployableObject getDeployableObject(); 048 049 /** 050 * A convenience method to return the DTD version number. The DeployableObject has this information. 051 * 052 * Note: the method getDDBeanRootVersion() is preferred to this method. 053 * @see #getDDBeanRootVersion 054 * 055 * @return a string containing the DTD version number 056 */ 057 public String getModuleDTDVersion(); 058 059 /** 060 * A convenience method to return the version number of an 061 * XML instance document. This method is replacing the 062 * method DeployableObject.getModuleDTDVersion, because 063 * it returns the version number of any J2EE XML instance document 064 * 065 * @return <p>a string that is the version number of the XML instance document. 066 * Null is returned if no version number can be found.</p> 067 * <p>A module's deployment descriptor file always contains 068 * a document type identifier, DOCTYPE. The DOCTYPE statement 069 * contains the module DTD version number in the label of the 070 * statement.</p> 071 * <p>The format of the DOCTYPE statement is:</p> 072 * <pre><!DOCTYPE root_element PUBLIC "-//organization//label//language" "location"></pre> 073 * <dl> 074 * <dt>root_element</dt><dd>is the name of the root document in the DTD.</dd> 075 * <dt>organization</dt><dd>is the name of the organization responsible 076 * for the creation and maintenance of the DTD 077 * being referenced.</dd> 078 * <dt>label</dt><dd>is a unique descriptive name for the public text being 079 * referenced. </dd> 080 * <dt>language</dt><dd>is the ISO 639 language id representing the natural 081 * language encoding of th DTD.</dd> 082 * <dt>location</dt><dd>is the URL of the DTD.</dd> 083 * </dl> 084 * <p>An example J2EE deployment descriptor DOCTYPE statement is:</p> 085 * <pre><!DOCTYPE application-client PUBLIC 086 * "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" 087 * "http://java.sun.com/dtd/application-client_1_3.dtd"></pre> 088 * <p>In this example the label is, "DTD J2EE Application Client 1.3", 089 * and the DTD version number is 1.3. A call to getModuleDTDVersion 090 * would return a string containing, "1.3".</p> 091 */ 092 public String getDDBeanRootVersion(); 093 094 /** 095 * Return the XPath for this standard bean. The root XPath is "/". 096 * 097 * @return "/" this is the root standard bean. 098 */ 099 public String getXpath(); 100 101 /** 102 * Returns the filename relative to the root of the module of the XML instance document this 103 * DDBeanRoot represents. 104 * 105 * @since 1.1 106 * 107 * @return String the filename relative to the root of the module 108 */ 109 public String getFilename(); 110 }