Class JCRWrapperPropertyEditor<T extends Wrapper>

  • Type Parameters:
    T - Wrapper class to create the property editor for
    All Implemented Interfaces:
    PropertyEditor

    public class JCRWrapperPropertyEditor<T extends Wrapper>
    extends PropertyEditorSupport
    This class represents a generic property editor for JCR wrappers. It provided an editor for all classes that implement the Wrapper interface. The property editor uses the UUID of the wrapper for String representation and WebManager session to retrieve the object from a given UUID. Therefore the WebManager session is input parameter of the constructor of this property editor. The property editor uses generics to specify the wrapper type it should support. Add this property editor in your initBinder method. For example to define a property editor for the language:
    public void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { super.initBinder(request, binder); // Register basic property editors binder.registerCustomEditor(Language.class, new JCRWrapperPropertyEditor(getWmSession(request))); }