You may want to use a schema
or bean-property
tag to expose the simple properties of a sub-property as its own. For example, you might want the schema for OrderImpl
to expose simple properties from its repositoryItem
sub-property.
Use the include-simple-properties-from
tag to generate property
tags with their internal-property-name
attribute set. In the following example, the property elements are generated for the simple properties of OrderImpl
, following property elements for the simple properties of the order repository item:
<schema id="order"> <bean class="atg.commerce.order.OrderImpl" include-all-simple="true"/> <include-simple-properties-from property="repositoryItem"> <item-descriptor repository="atg/commerce/order/OrderRepository" item-type="order"/> </include-simple-properties-from> </schema>
How to Validate Dynamic Bean Sub-Properties
The ValidatorManager
class validates a dynamic bean’s sub-properties. Note that you do not have to extend the ValidationManager
class to implement inter-property validation. The parent source and target beans are available on the ValidatorContext
, so a validator can find its parent and check for a given property.
You may also want to update the SwitchingUpdatingValidator
to handle creation of per-value target beans or repository items.