public interface CreateCapability
Important note: Do not provide an implementation of this interface unless you are a DD API provider!
Modifier and Type | Method and Description |
---|---|
CommonDDBean |
addBean(String beanName)
An empty bean is created corresponding to beanName, regardless the servlet spec.
|
CommonDDBean |
addBean(String beanName,
String[] propertyNames,
Object[] propertyValues,
String keyProperty)
An empty bean is created corresponding to beanName regardless the srvlet spec.
|
CommonDDBean |
createBean(String beanName)
An empty (not bound to bean graph) CommonDDBean object is created corresponding to beanName,
regardless the servlet spec.
|
CommonDDBean createBean(String beanName) throws ClassNotFoundException
beanName
- bean name e.g. "Servlet"ClassNotFoundException
CommonDDBean addBean(String beanName, String[] propertyNames, Object[] propertyValues, String keyProperty) throws ClassNotFoundException, NameAlreadyUsedException
... Servlet servlet = (Servlet)webApp.addBean("Servlet",new String[]{"ServletName","ServletClass"}, new Object[]{"TestServlet","mypackage.TestServlet"},"ServletName"); servlet.addBean("InitParam",new String[]{"ParamName","ParamValue"}, new Object[]{"car","Volvo"},"ParamName"); ...
beanName
- bean namepropertyNames
- array of properties that should be initializedpropertyValues
- array of initialization values, usually stringskeyProperty
- the property name that is checked in order to evoid the duplicity, e.g. ServletName.ClassNotFoundException
- thrown when the class for beanName cannot be found under the current DD elementNameAlreadyUsedException
- thrown when object with keyProperty value already exists.CommonDDBean addBean(String beanName) throws ClassNotFoundException
... JspConfig config = webApp.addBean("JspConfig"); jspConfig.addBean("JspPropertyGroup",new String[]{"UrlPattern","IncludePrelude","IncludeCoda"}, new String[]{"*.jsp","/jsp/prelude.html","/jsp/coda.html"},null); ...
beanName
- bean name e.g. "JspConfig"ClassNotFoundException
- thrown when the class for beanName cannot be found under the current DD element