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 - {@link 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 {@link org.netbeans.api.web.dd.DDProvider} class.
The DD API provides no UI for deployment descriptor editing.
All DD API interfaces are included to this package.
Here is the hierarchic structure of the DD API interfaces :
{@link org.netbeans.api.web.dd.WebApp} - {@link org.netbeans.api.web.dd.Icon} [*] - {@link org.netbeans.api.web.dd.InitParam} [*] - {@link org.netbeans.api.web.dd.Filter} [*] - {@link org.netbeans.api.web.dd.Icon} [*] - {@link org.netbeans.api.web.dd.InitParam} [*] - {@link org.netbeans.api.web.dd.FilterMapping} [*] - {@link org.netbeans.api.web.dd.Listener} [*] - {@link org.netbeans.api.web.dd.Icon} [*] - {@link org.netbeans.api.web.dd.Servlet} [*] - {@link org.netbeans.api.web.dd.Icon} [*] - {@link org.netbeans.api.web.dd.InitParam} [*] - {@link org.netbeans.api.web.dd.RunAs} [*] - {@link org.netbeans.api.web.dd.SecurityRoleRef} [*] - {@link org.netbeans.api.web.dd.ServletMapping} [*] - {@link org.netbeans.api.web.dd.SessionConfig} [?] - {@link org.netbeans.api.web.dd.MimeMapping} [*] - {@link org.netbeans.api.web.dd.WelcomeFileList} [?] - {@link org.netbeans.api.web.dd.ErrorPage} [*] - {@link org.netbeans.api.web.dd.Taglib} [*] - {@link org.netbeans.api.web.dd.JspConfig} [?] - {@link org.netbeans.api.web.dd.Taglib} [*] - {@link org.netbeans.api.web.dd.JspPropertyGroup} [*] - {@link org.netbeans.api.web.dd.SecurityConstraint} [*] - {@link org.netbeans.api.web.dd.WebResourceCollection} [+] - {@link org.netbeans.api.web.dd.AuthConstraint} [?] - {@link org.netbeans.api.web.dd.UserDataConstraint} [?] - {@link org.netbeans.api.web.dd.LoginConfig} [?] - {@link org.netbeans.api.web.dd.FormLoginConfig} [?] - {@link org.netbeans.api.web.dd.SecurityRole} [*] - {@link org.netbeans.api.web.dd.EnvEntry} [*] - {@link org.netbeans.api.web.dd.EjbRef} [*] - {@link org.netbeans.api.web.dd.EjbLocalRef} [*] - {@link org.netbeans.api.web.dd.ServiceRef} [*] - {@link org.netbeans.api.web.dd.Icon} [*] - {@link org.netbeans.api.web.dd.PortComponentRef} [*] - {@link org.netbeans.api.web.dd.ServiceRefHandler} [*] - {@link org.netbeans.api.web.dd.InitParam} [*] - {@link org.netbeans.api.web.dd.ResourceRef} [*] - {@link org.netbeans.api.web.dd.ResourceEnvRef} [*] - {@link org.netbeans.api.web.dd.MessageDestinationRef} [*] - {@link org.netbeans.api.web.dd.MessageDestination} [*] - {@link org.netbeans.api.web.dd.Icon} [*] - {@link org.netbeans.api.web.dd.LocaleEncodingMappingList} [?] - {@link 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)
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 :
Provides the access to the deployment descriptor root - {@link org.netbeans.api.web.dd.WebApp} - object.
The {@link org.netbeans.api.web.dd.DDProvider} class is a singleton and caches the WebApp objects in IDE.
There are following methods for accessing {@link org.netbeans.api.web.dd.WebApp} object in DDProvider :
DD API enables the full modification of deployment descriptor elements including:
See the Examples of usage.
The modificated {@link 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 :