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

org.netbeans.modules.j2ee.dd.api.common
Interface CommonDDBean

All Known Subinterfaces:
ActivationConfig, ActivationConfigProperty, AppClient, Application, AssemblyDescriptor, AuthConstraint, CmpField, CmrField, ComponentInterface, ContainerTransaction, Ejb, EjbJar, EjbLocalRef, EjbRef, EjbRelation, EjbRelationshipRole, EnterpriseBeans, Entity, EntityAndSession, EnvEntry, ErrorPage, Filter, FilterMapping, FormLoginConfig, Icon, InitParam, InjectionComplete, InjectionTarget, JspConfig, JspPropertyGroup, Listener, LocaleEncodingMapping, LocaleEncodingMappingList, LoginConfig, MessageDestination, MessageDestinationRef, MessageDriven, MessageDrivenDestination, Method, MethodParams, MethodPermission, MimeMapping, Module, PortComponentRef, Query, QueryMethod, RelationshipRoleSource, Relationships, ResourceEnvRef, ResourceRef, RootInterface, RunAs, SecurityConstraint, SecurityIdentity, SecurityRole, SecurityRoleRef, ServiceRef, ServiceRefHandler, Servlet, ServletMapping, Session, SessionConfig, Taglib, UserDataConstraint, Web, WebApp, WebResourceCollection, WelcomeFileList

public interface CommonDDBean

Parent of all DD API interfaces.

Important note: Do not provide an implementation of this interface unless you are a DD API provider!


Method Summary
 void addPropertyChangeListener(PropertyChangeListener pcl)
          Adds property change listener to particular CommonDDBean object (WebApp object).
 Object clone()
          Returns the clonned CommonDDBean object.
 String getId()
          Returns the id attribute for related dd element.
In most cases the id attribute is not specified.
 Object getValue(String propertyName)
          Returns the CommonDDBean object or array of CommonDDBean object for given property.
E.g.
 void removePropertyChangeListener(PropertyChangeListener pcl)
          Removes property change listener from CommonDDBean object.
 void setId(String value)
          Sets the id attribute for related dd element.
 void write(OutputStream os)
          Writes the whole DD or its fraction (element related to CommonDDBean) to output stream.
For DD root object there is more convenient to use the RootInterface.write(org.openide.filesystems.FileObject) method.
The correct usage with file objects is :
 

Method Detail

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener pcl)
Adds property change listener to particular CommonDDBean object (WebApp object).

Parameters:
pcl - property change listener

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener pcl)
Removes property change listener from CommonDDBean object.

Parameters:
pcl - property change listener

setId

void setId(String value)
Sets the id attribute for related dd element. E.g.
<servlet id="xyz">
  ...
</servlet>

Parameters:
value - the value for id attribute

getId

String getId()
Returns the id attribute for related dd element.
In most cases the id attribute is not specified.

Returns:
value of id attribute or null if not specified

clone

Object clone()
Returns the clonned CommonDDBean object.

Returns:
the clonned (not bound to bean graph) CommonDDBean object

getValue

Object getValue(String propertyName)
Returns the CommonDDBean object or array of CommonDDBean object for given property.
E.g. for retrieving the servlet-class value on Servlet object he getValue("ServletClass"); can be used.

Parameters:
propertyName - name of the property the value is looking for
Returns:
the bean/array of beans related to given property

write

void write(OutputStream os)
           throws IOException
Writes the whole DD or its fraction (element related to CommonDDBean) to output stream.
For DD root object there is more convenient to use the RootInterface.write(org.openide.filesystems.FileObject) method.
The correct usage with file objects is :
WebApp ejb;
FileObject fo;
...
//  code that initializes and modifies the ejb object
...
FileLock lock;
try {
    lock=fo.lock();
} catch (FileAlreadyLockedException e) {
    // handling the exception
}
if (lock!=null) {
    try {
        OutputStream os=fo.getOutputStream(lock);
        try {
            ejb.write(os);
        } finally {
            os.close();
        }
    } finally {
        lock.releaseLock();
    }
}
...

Parameters:
os - output stream for writing
Throws:
IOException

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

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