KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > web > dd > common > CreateCapability


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.api.web.dd.common;
21 /**
22  * Ability to create a new CommonDDBean objects.
23  *
24  *<p><b><font color="red"><em>Important note: Do not provide an implementation of this interface unless you are a DD API provider!</em></font></b>
25  *</p>
26  *
27  * @deprecated Use the API for web module deployment descriptor in j2ee/ddapi module.
28  * @author Milan Kuchtiak
29  */

30 public interface CreateCapability {
31     /**
32      * An empty (not bound to bean graph) CommonDDBean object is created corresponding to beanName,
33      * regardless the servlet spec. version
34      * @param beanName bean name e.g. "Servlet"
35      * @return CommonDDBean object corresponding to beanName value
36      */

37     public CommonDDBean createBean(String JavaDoc beanName) throws ClassNotFoundException JavaDoc ;
38     /**
39      * An empty bean is created corresponding to beanName regardless the srvlet spec. version.
40      * The bean is nested under the actual bean.<br>
41      * There is an array of properties that will be initialized.
42      * The method is useful for DD elements containing
43      * single properties like Servlet, Taglib, ResourceRef etc.<br>
44      * Usage<pre>
45 ...
46 Servlet servlet = (Servlet)webApp.addBean("Servlet",new String[]{"ServletName","ServletClass"},
47                                           new Object[]{"TestServlet","mypackage.TestServlet"},"ServletName");
48 servlet.addBean("InitParam",new String[]{"ParamName","ParamValue"},
49                 new Object[]{"car","Volvo"},"ParamName");
50 ...
51      *</pre>
52      * @param beanName bean name
53      * @param propertyNames array of properties that should be initialized
54      * @param propertyValues array of initialization values, usually strings
55      * @param keyProperty the property name that is checked in order to evoid the duplicity, e.g. ServletName.<br>
56      * <b>keyProperty should be included to propertyNames array.</b>
57      * @return CommonDDBean object that has been nested inside the current element (CommonDDBean object).
58      * @exception ClassNotFoundException thrown when the class for beanName cannot be found under the current DD element
59      * @exception NameAlreadyUsedException thrown when object with keyProperty value already exists.
60      */

61     public CommonDDBean addBean (String JavaDoc beanName, String JavaDoc[] propertyNames, Object JavaDoc [] propertyValues, String JavaDoc keyProperty)
62         throws ClassNotFoundException JavaDoc, NameAlreadyUsedException;
63     /**
64      * An empty bean is created corresponding to beanName, regardless the servlet spec. version.
65      * The bean is included under the actual bean. The method is useful for elements containing only
66      * non-single properties like WelcomeFileList, JspConfig etc.
67      *<pre>
68 ...
69 JspConfig config = webApp.addBean("JspConfig");
70 jspConfig.addBean("JspPropertyGroup",new String[]{"UrlPattern","IncludePrelude","IncludeCoda"},
71                   new String[]{"*.jsp","/jsp/prelude.html","/jsp/coda.html"},null);
72 ...
73      *</pre>
74      * @param beanName bean name e.g. "JspConfig"
75      * @return CommonDDBean object corresponding to beanName value
76      * @exception ClassNotFoundException thrown when the class for beanName cannot be found under the current DD element
77      */

78     public CommonDDBean addBean (String JavaDoc beanName) throws ClassNotFoundException JavaDoc;
79 }
80
Popular Tags