You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

Error formatting macro: snippet: java.lang.NullPointerException

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"

  • No labels