|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.riotfamily.forms.factory.ConfigurableElementFactory
public class ConfigurableElementFactory
Configurable element factory that can be used to create arbitary
form elements. This class is used by
XmlFormRepositoryDigester
but could also be useful for custom implementations.
| Constructor Summary | |
|---|---|
ConfigurableElementFactory(Class<? extends Element> elementClass)
Creates a new factory for the given element class. |
|
| Method Summary | |
|---|---|
void |
addChildFactory(ElementFactory factory)
Adds an ElementFactory to the list of child factories. |
protected void |
createChildElements(ContainerElement parent,
Form form)
|
Element |
createElement(Element parent,
Form form,
boolean bind)
Returns a new instance of the configured element class. |
protected BeanEditor |
findEditor(Element parent,
Form form)
|
Class<?> |
getBeanClass()
|
String |
getBind()
Returns the name of the property that elements created by this factory shall be bound to or null if no binding should be
performed. |
List<ElementFactory> |
getChildFactories()
Returns a list of element factories used to create nested elements. |
Class<? extends Element> |
getElementClass()
|
protected void |
populateElement(Element element)
Called by #createElement(Element, Form) to populate the given
element with the property values set via
setPropertyValues(PropertyValues). |
protected Object |
resolveValueIfNecessary(Object value)
Called by populateElement(Element) to support runtime
references to prototype beans. |
void |
setBeanClass(Class<?> beanClass)
If the factory is set up to create a BeanEditor, the
type of the bean that is to be edited can be set. |
void |
setBeanFactory(ConfigurableListableBeanFactory beanFactory)
Sets the BeanFactory that is used to lookup bean references. |
void |
setBind(String bind)
Sets the name of the property that elements created by this factory shall be bound to. |
void |
setChildFactories(List<ElementFactory> childFactories)
Sets a list of element factories that will be used to create child elements which will be added to the elements beeing created by this factory. |
void |
setPropertyValues(PropertyValues propertyValues)
Sets the PropertyValues that will be set on the element after creation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConfigurableElementFactory(Class<? extends Element> elementClass)
| Method Detail |
|---|
public Class<? extends Element> getElementClass()
public void setBeanFactory(ConfigurableListableBeanFactory beanFactory)
public void setPropertyValues(PropertyValues propertyValues)
public void setBeanClass(Class<?> beanClass)
BeanEditor, the
type of the bean that is to be edited can be set.
FormDefinitionException - if the element does not implement
BeanEditorpublic Class<?> getBeanClass()
public void setBind(String bind)
FormDefinitionException - if the element does not implement
Editorpublic String getBind()
null if no binding should be
performed.
getBind in interface EditorElementFactoryEditorElementFactory.getBind()public void setChildFactories(List<ElementFactory> childFactories)
FormDefinitionException - if the element does not implement
ContainerElementpublic void addChildFactory(ElementFactory factory)
addChildFactory in interface ContainerElementFactorysetChildFactories(List)public List<ElementFactory> getChildFactories()
getChildFactories in interface ContainerElementFactorysetChildFactories(List)
public Element createElement(Element parent,
Form form,
boolean bind)
createElement in interface ElementFactoryElementFactory.createElement(Element, Form, boolean)protected void populateElement(Element element)
#createElement(Element, Form) to populate the given
element with the property values set via
setPropertyValues(PropertyValues). Values will be resolved if
necessary by calling resolveValueIfNecessary(Object).
protected Object resolveValueIfNecessary(Object value)
populateElement(Element) to support runtime
references to prototype beans.
RuntimeBeanReference
protected void createChildElements(ContainerElement parent,
Form form)
protected BeanEditor findEditor(Element parent,
Form form)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||