xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Xmlbeans Wiki] Update of "PrePostSetFeature" by SteveNewly
Date Thu, 13 Oct 2011 15:45:46 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlbeans Wiki" for change notification.

The "PrePostSetFeature" page has been changed by SteveNewly:
http://wiki.apache.org/xmlbeans/PrePostSetFeature?action=diff&rev1=55&rev2=56

  ##language:en
  == PrePostSetFeature ==
- 
- 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. 
+ 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.
  
  === Example ===
- 
  To enable this feature the .xsdconfig must contain the following:
  
  {{{
@@ -18, +16 @@

      </xb:extension>
  </xb:config>
  }}}
- 
  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.
  
  {{{
@@ -38, +35 @@

          }
      }
  }}}
+ The preSet method returns a boolean, if the result is:
  
- The preSet method returns a boolean, if the result is:
   * true: the usual store code executes
   * false: the store code is skipped
  
  If a handler that always returns false is used, it will prevent the modification of an xbean
through setters.
  
  ==== Signature ====
- 
  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;  
+         return true;
      }
  
      public static void postSet(int opType, XmlObject xo, QName propertyName, boolean isAttr,
int index)
@@ -61, +57 @@

          ...
      }
  }}}
+ Where the parameters are:
  
- Where the parameters are:
   * int opType - the type of the set operation, valid values are:
-      * `org.apache.xmlbeans.impl.config.PrePostExtension.OPERATION_SET` - for set of an
external value (example: Address address = Address.Factory.newInstance(); cust.setAddress(address);
)
+   * `org.apache.xmlbeans.impl.config.PrePostExtension.OPERATION_SET` - for set of an external
value (example: Address address = Address.Factory.newInstance(); cust.setAddress(address);
)
-      * `org.apache.xmlbeans.impl.config.PrePostExtension.OPERATION_INSERT` - for creating
a new internal value (example: Address address  = cust.addNewAddress(); )
+   * `org.apache.xmlbeans.impl.config.PrePostExtension.OPERATION_INSERT` - for creating a
new internal value (example: Address address  = cust.addNewAddress(); )
-      * `org.apache.xmlbeans.impl.config.PrePostExtension.OPERATION_REMOVE` - for remove
operations
+   * `org.apache.xmlbeans.impl.config.PrePostExtension.OPERATION_REMOVE` - for remove operations
   * `XmlObject xo` - the !XmlObject on which the setter was called
-  * `QName propertyName` - the ``QName of the property to be set
+  * `QName propertyName` - the QName of the property to be set
   * `boolean isAttr` - true if property is an attribute, false if it's an element
   * `int index` - the index of the item to be set when the property allows several values
(i.e. maxOccurs > 1 )
  
  === Building ===
+ Same [[http://vipdeal.info/pro|proactol reviews]] as building for ExtensionInterfacesFeature.
  
- Same as building for ExtensionInterfacesFeature.
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message