An implementation of the ObjectPropertyAccessor that provides conversion for Qi4j properties. The typical way that OGNL gets/sets object attributes is by finding the corresponding JavaBean getter/setter methods. This ObjectPropertyAccessor checks if there is a Qi4j property on the Composite and if there is uses the properties get/set methods.
When setting Property values, if a ConstraintViolationException is thrown it is added to the context so that it can be processed and by the ConstraintViolationInterceptor, similar to how conversion exceptions are handled by the ConversionErrorInterceptor
When setting Association values, we attempt to convert the value to the association type using the normal XWork converter mechanisms. If the type is an EntityComposite, we already have a converter registered {@link EntityCompositeConverter} to handle conversion from a string identity to an object. If the type is not anEntityComposite, but the actual values are EntityComposites, you can register the {@link EntityCompositeConverter}for your type in your xwork-conversion.properties file.
NOTE: We can't do this as a regular converter because Qi4j composites doesn't (nor should it be) following the JavaBean standard. We might be able to only override the getProperty() method here and have regular converters for Property, Association and SetAssociation but I haven't tried that yet so it may not work as expected.>
TODO: Doesn't yet handle ManyAssociations, but these shouldn't be too hard to add
|
|
|
|
|
|
|
|
|
|