org.netbeans.modules.j2ee.dd/1 1.12.0 2

J2EE DD API
Friend, Private or Third Party

The DD API has been developed in order to satisfy the requirement to access the web module deployment descriptor for other Netbeans modules in a simple and servlet spec.-independant way.

See:
          Description

J2EE DD API
org.netbeans.modules.j2ee.dd.api.application Interfaces for working with J2EE application deployment descriptor, DDProvider class.
org.netbeans.modules.j2ee.dd.api.client  
org.netbeans.modules.j2ee.dd.api.common Super-interfaces for deployment descriptor, common interfaces for EJB and Web module deployment descriptor, J2EE DD API exceptions.
org.netbeans.modules.j2ee.dd.api.ejb Interfaces for working with ejb module deployment descriptor, DDProvider class.
org.netbeans.modules.j2ee.dd.api.web Interfaces for working with web module deployment descriptor, DDProvider class.
org.netbeans.modules.j2ee.dd.spi  
org.netbeans.modules.j2ee.dd.spi.client  
org.netbeans.modules.j2ee.dd.spi.ejb  
org.netbeans.modules.j2ee.dd.spi.web  

 

The DD API has been developed in order to satisfy the requirement to access the web module deployment descriptor for other Netbeans modules in a simple and servlet spec.-independant way.

1. The Overall Architecture

The DD API is based on a bunch of interfaces based on the deployment descriptor xml structure. The names of interfaces correspond to the names of deployment descriptor elements in web.xml file. The DD API interfaces are organized in a hierarchic tree structure where they are accassible through the root - org.netbeans.api.web.dd.WebApp - interface. The implementation of DD API interfaces is hidden for clients. It is based on schema2beans infrastructure and is the DD version - specific. (there is always requirement to support at least two successive versions of DD specification). The root of the deployment descriptor is accessible through the org.netbeans.api.web.dd.DDProvider class.

2. What it is not.

The DD API provides no UI for deployment descriptor editing.

3. The Hierarchic structure of DD API Interfaces

Package: org.netbeans.api.web.dd

All DD API interfaces are included to this package.
Here is the hierarchic structure of the DD API interfaces :

org.netbeans.api.web.dd.WebApp
  - org.netbeans.api.web.dd.Icon [*]
  - org.netbeans.api.web.dd.InitParam [*]
  - org.netbeans.api.web.dd.Filter [*]
    - org.netbeans.api.web.dd.Icon [*]
    - org.netbeans.api.web.dd.InitParam [*]
  - org.netbeans.api.web.dd.FilterMapping [*]
  - org.netbeans.api.web.dd.Listener [*]
    - org.netbeans.api.web.dd.Icon [*]
  - org.netbeans.api.web.dd.Servlet [*]
    - org.netbeans.api.web.dd.Icon [*]
    - org.netbeans.api.web.dd.InitParam [*]
    - org.netbeans.api.web.dd.RunAs [*]
    - org.netbeans.api.web.dd.SecurityRoleRef [*]
  - org.netbeans.api.web.dd.ServletMapping [*]
  - org.netbeans.api.web.dd.SessionConfig [?]  
  - org.netbeans.api.web.dd.MimeMapping [*]
  - org.netbeans.api.web.dd.WelcomeFileList [?]
  - org.netbeans.api.web.dd.ErrorPage [*]
  - org.netbeans.api.web.dd.Taglib [*]
  - org.netbeans.api.web.dd.JspConfig [?]
    - org.netbeans.api.web.dd.Taglib [*]
    - org.netbeans.api.web.dd.JspPropertyGroup [*]
  - org.netbeans.api.web.dd.SecurityConstraint [*]
    - org.netbeans.api.web.dd.WebResourceCollection [+]
    - org.netbeans.api.web.dd.AuthConstraint [?]
    - org.netbeans.api.web.dd.UserDataConstraint [?]
  - org.netbeans.api.web.dd.LoginConfig [?]
    - org.netbeans.api.web.dd.FormLoginConfig [?]
  - org.netbeans.api.web.dd.SecurityRole [*]
  - org.netbeans.api.web.dd.EnvEntry [*]
  - org.netbeans.api.web.dd.EjbRef [*]
  - org.netbeans.api.web.dd.EjbLocalRef [*]
  - org.netbeans.api.web.dd.ServiceRef [*]
    - org.netbeans.api.web.dd.Icon [*]
    - org.netbeans.api.web.dd.PortComponentRef [*]
    - org.netbeans.api.web.dd.ServiceRefHandler [*]
      - org.netbeans.api.web.dd.InitParam [*]
  - org.netbeans.api.web.dd.ResourceRef [*]
  - org.netbeans.api.web.dd.ResourceEnvRef [*]
  - org.netbeans.api.web.dd.MessageDestinationRef [*]
  - org.netbeans.api.web.dd.MessageDestination [*]
    - org.netbeans.api.web.dd.Icon [*]
  - org.netbeans.api.web.dd.LocaleEncodingMappingList [?]
    - org.netbeans.api.web.dd.LocaleEncodingMapping [+]

Comments : 
[*] - objects occur multiple times in parent object (0-n)
[+] - objects occur multiple times in parent object (1-n)
[?] - object can occur only once in parent object (0-1)

4. The structure of method names.

The syntax and usage of interfaces methods is very simple and straightforward.
If certain object [of XYZ interface] occurs multiple times in parent object these methods are present in parent interface :


If certain object [of XYZ interface] can occur only once in parent object these methods are present in parent interface :
Example : The org.netbeans.api.web.dd.WebApp interface contains these methods for getting/setting org.netbeans.api.web.dd.Servlets and org.netbeans.api.web.dd.WelcomeFileList :
Interfaces contain additional methods corresponding to the simple(String) properties following the deployment descriptor xml syntax.
Example : The org.netbeans.api.web.dd.Taglib interface contains these additional getters/setters :
Interfaces usually extends some interfaces from the org.netbeans.api.web.dd.common package. For example if a DD element has the description property, it extends the org.netbeans.api.web.dd.common.DescriptionInterface containing the methods for description property handling.
Example : The org.netbeans.api.web.dd.WebApp, org.netbeans.api.web.dd.Servlet, org.netbeans.api.web.dd.Filter, org.netbeans.api.web.dd.Listener, org.netbeans.api.web.dd.ServiceRef, org.netbeans.api.web.dd.WebResourceCollection interfaces have the additional functionality for description proprty.

5. DDProvider class - getting the root interface from web.xml file.

Package: org.netbeans.api.web.dd

Provides the access to the deployment descriptor root - org.netbeans.api.web.dd.WebApp - object. The org.netbeans.api.web.dd.DDProvider class is a singleton and caches the WebApp objects in IDE.
There are following methods for accessing org.netbeans.api.web.dd.WebApp object in DDProvider :

6. Deployment descriptor modification.

DD API enables the full modification of deployment descriptor elements including:

See the Examples of usage.

7. Writing changes.

The modificated org.netbeans.api.web.dd.WebApp object can be serialized to FileObject using :

There is also another write mathod available on any interface to serialize the fraction of deployment descriptor to OutputStream :

See the Examples of usage.


See also :


org.netbeans.modules.j2ee.dd/1 1.12.0 2

Built on August 21 2008.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.