XBean supports custom XML languages for different libraries of Java code. This page details some guidelines.
References
To refer to another POJO inside XBean you can use the # character to refer to another bean in the same file. This is similar to the <property name="foo" ref="bar"/> style in Spring.
e.g. consider this example
Wiki Markup |
---|
{snippet:id=xml|lang=xml|url=http://svn.xbean.codehaus.org/trunk/spring/src/test/org/xbean/spring/context/pizza-xbean-bean-ref.xml?rev=104} |
The topping bean is configured using the regular Spring way; the pizza bean is configured using XBean XML; however notice that the pizza bean is configured via the reference #topping. If you really do want to configure a property with a string which starts with # then escape it as ## as we are doing with the cheese property in this example. i.e. the cheese property will be set to the string "#Edam"