logo       

RE: Implementation Pluggability: msg#00158

text.xml.xmlbeans.user

Subject: RE: Implementation Pluggability

I found this page : http://dev2dev.bea.com/technologies/xmlbeans/articles/Configuring_XMLBeans.jsp

It pretty much explains everything.

 

Serge Simard, ext. 5900

-----Original Message-----
From: Sudhir Srinivas [mailto:sudhir.srinivas@xxxxxxxxxx]
Sent: January 26, 2005 11:22 PM
To: user@xxxxxxxxxxxxxxxxxxx
Subject: RE: Implementation Pluggability

 

 

Thanks for the prompt reply.

Can I do the same thing for get calls as well ?

Is there something like a preGet and a postGet as well ?

-----Original Message-----
From: Serge Simard [mailto:serge.simard@xxxxxxx]
Sent: Wednesday, January 26, 2005 8:06 PM
To: user@xxxxxxxxxxxxxxxxxxx
Subject: RE: Implementation Pluggability

You can use a schema configuration file (.xsdconfig) to specify an extension class to be called when set get calls occur :

 

1) Put such a directive for the compiler to generate the callbacks in your schema generated classes :

 

<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"

               xmlns:dto="http://www.cgi.com/awfm/dto">

                            

   <xb:extension for="" qualified class names to instrument with callbacks">

            <xb:prePostSet>

                        <xb:staticHandler>fully qualified name of the class the implements the callback static  functions</xb:staticHandler>

            </xb:prePostSet>        

   </xb:extension>

  

</xb:config>

 

2) implement a class for the call backs…

 

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

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

 

3) Check xmlbeans for actual and recent info, but this works for 1.0.3…

 

Good luck…

 

Serge Simard, ext. 5900

-----Original Message-----
From: Sudhir Srinivas [mailto:sudhir.srinivas@xxxxxxxxxx]
Sent: January 26, 2005 10:49 PM
To: user@xxxxxxxxxxxxxxxxxxx
Subject: Implementation Pluggability

 

Hi,

I am investigating the use of XML Beans on a project and I had the following question - I have the requirement to be able to intercept the getX and getY calls and add custom logic. Is there anyway in which this can be accomplished - like generating a custom sub class ( my sub class) of org.apache.xmlbeans.impl.values.XmlObjectBase ?

 

Thanks

 

- Sudhir

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise