Difference between revisions of "Beans (extension point)"
From BioUML platform
Tagir Valeev (Talk | contribs) (Created page with "{{Extension point|beans|ru.biosoft.access|since=0.9.4|registry=ru.biosoft.access.BeanRegistry}} === Description === This extension point allows you to resolve Java objects by ...") |
Revision as of 15:48, 13 May 2013
- Identifier
- ru.biosoft.access.beans
- Plugin
- ru.biosoft.access
- Since
- 0.9.4
- Registry
BeanRegistry
Description
This extension point allows you to resolve Java objects by paths in BioUML runtime. Objects located in the tree can be resolved via BioUML repository, but sometimes it's desired to have a static link to some other object (even not DataElement). For this purpose ru.biosoft.access.BeanRegistry.getBean(String)
method can be used.
Using this extension point you may register your own prefix to resolve all objects which names start with given prefix. To achieve this you have to implement BeanProvider
interface and register the created class as an extension.
Configuration Markup
<!ELEMENT provider> <!ATTLIST provider class CDATA #REQUIRED prefix CDATA #REQUIRED >
- class
- Fully-qualified name of the class implementing
ru.biosoft.access.BeanProvider
interface. - prefix
- Prefix, cannot end with
"/"
. Only latin letters and"/"
are allowed to use in prefix. All paths starting with this prefix will be handled by your class unless more detailed handler is registered. For example, if class A is registered for"properties/myplugin"
prefix and class B is registered for"properties/myplugin/deep"
prefix, then all paths starting with"properties/myplugin/deep"
will be handled by class B, while all other paths starting with"properties/myplugin"
will be handled by class A. If two classes are registered for the same prefix, it's undefined which one will handle it.
Notes
-
getBean
method always looks first in the BioUML repository for the supplied path. Thus be careful to avoid names collisions. It's recommended to start prefix with"properties/"
.
- When you implement
BeanProvider
interface, please note that parameter passed togetBean
method is not the full path, but the path except the prefix.
- Currently this extension point is mainly used by BioUML web edition code. See
WebBeanProvider
for details.
Example
<extension point="ru.biosoft.access.beans"> <provider class="ru.biosoft.table.TableCellBeanProvider" prefix="properties/tableCell"/> </extension>
All paths starting with "properties/tableCell" will be handled by TableCellBeanProvider
.