When the prepostset feature is enabled in a .xsdconfig file, pre and post calls to the handler will be generated at the beginning and at the end of all the setter methods of the specifyed xbeans.


To enable this feature the .xsdconfig must contain the following:

<xb:config xmlns:xb="">
    <xb:extension for="*">

The extension element specifies a set of xbeans (see ExtensionInterfacesFeature), for this set of xbeans, in all the setter methods calls to the preSet and postSet handler methods will be generated.

     * Sets the "config" element
    public void setConfig(org.apache.xml.xmlbeans.x2004.x02.xbean.config.ConfigDocument.Config config)
        synchronized (monitor())
            if ( myPackage.FooHandler.preSet(...) )
                ... store implementation code

The preSet method returns a boolean, if the result is:

If a handler that always returns false is used, it will prevent the modification of an xbean through setters.


The handler specified in the staticHandler element must have the following two static methods:

    public static boolean preSet(int opType, XmlObject xo, QName prop, boolean isAttr, int index)
        return true;  

    public static void postSet(int opType, XmlObject xo, QName propertyName, boolean isAttr, int index)

Where the parameters are:


Same as building for ExtensionInterfacesFeature.

PrePostSetFeature (last edited 2011-12-19 22:14:02 by c-98-195-211-55)