Skip navigation links
org.netbeans.modules.j2ee.dd/1 1.64.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 
Package Description
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.api.web.model  
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 - 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 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: api.web.dd

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

api.web.dd.WebApp
  - api.web.dd.Icon [*]
  - api.web.dd.InitParam [*]
  - api.web.dd.Filter [*]
    - api.web.dd.Icon [*]
    - api.web.dd.InitParam [*]
  - api.web.dd.FilterMapping [*]
  - api.web.dd.Listener [*]
    - api.web.dd.Icon [*]
  - api.web.dd.Servlet [*]
    - api.web.dd.Icon [*]
    - api.web.dd.InitParam [*]
    - api.web.dd.RunAs [*]
    - api.web.dd.SecurityRoleRef [*]
  - api.web.dd.ServletMapping [*]
  - api.web.dd.SessionConfig [?]  
  - api.web.dd.MimeMapping [*]
  - api.web.dd.WelcomeFileList [?]
  - api.web.dd.ErrorPage [*]
  - api.web.dd.Taglib [*]
  - api.web.dd.JspConfig [?]
    - api.web.dd.Taglib [*]
    - api.web.dd.JspPropertyGroup [*]
  - api.web.dd.SecurityConstraint [*]
    - api.web.dd.WebResourceCollection [+]
    - api.web.dd.AuthConstraint [?]
    - api.web.dd.UserDataConstraint [?]
  - api.web.dd.LoginConfig [?]
    - api.web.dd.FormLoginConfig [?]
  - api.web.dd.SecurityRole [*]
  - api.web.dd.EnvEntry [*]
  - api.web.dd.EjbRef [*]
  - api.web.dd.EjbLocalRef [*]
  - api.web.dd.ServiceRef [*]
    - api.web.dd.Icon [*]
    - api.web.dd.PortComponentRef [*]
    - api.web.dd.ServiceRefHandler [*]
      - api.web.dd.InitParam [*]
  - api.web.dd.ResourceRef [*]
  - api.web.dd.ResourceEnvRef [*]
  - api.web.dd.MessageDestinationRef [*]
  - api.web.dd.MessageDestination [*]
    - api.web.dd.Icon [*]
  - api.web.dd.LocaleEncodingMappingList [?]
    - 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 api.web.dd.WebApp interface contains these methods for getting/setting api.web.dd.Servlets and api.web.dd.WelcomeFileList :
Interfaces contain additional methods corresponding to the simple(String) properties following the deployment descriptor xml syntax.
Example : The api.web.dd.Taglib interface contains these additional getters/setters :
Interfaces usually extends some interfaces from the api.web.dd.common package. For example if a DD element has the description property, it extends the api.web.dd.common.DescriptionInterface containing the methods for description property handling.
Example : The api.web.dd.WebApp, api.web.dd.Servlet, api.web.dd.Filter, api.web.dd.Listener, api.web.dd.ServiceRef, api.web.dd.WebResourceCollection interfaces have the additional functionality for description proprty.

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

Package: api.web.dd

Provides the access to the deployment descriptor root - api.web.dd.WebApp - object. The api.web.dd.DDProvider class is a singleton and caches the WebApp objects in IDE.
There are following methods for accessing 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 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 :

Skip navigation links
org.netbeans.modules.j2ee.dd/1 1.64.0 2