Hi Rohit,

Assuming the element you want to process this way is embedded inside 
some other XML element (and the object to be unmarshalled is a property 
of some containing object), you should be able to just specify your 
custom unmarshaller for the object at that point in the binding. Then 
you can have a separate <mapping> definition for the object which 
defines the normal unmarshalling, and all your custom unmarshaller needs 
to do to invoke the normal unmarshalling is (1) create an instance of 
the object, and (2) cast this to org.jibx.runtime.IUnmarshallable and 
call the unmarshal() method.

If your element was the root of a document you could still use a similar 
approach, but you'd just need to implement it as front-end code (as in 
the http://jibx.sourceforge.net/tutorial/binding-custom.html#frontend 
example) rather than a custom unmarshaller.

- Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Rohit Seth wrote:
>
> Hi All,
>
> I want to write a custom unmarshaller to achieve the following:
>
> 1. Check the value of a specific attribute in start tag.
>
> 2. If the value is “XXX” return a specific object.
>
> 3. If not, continue with the normal (or default) unmarshalling.
>
> I am not sure how to go about the 3^rd step, i.e continue default 
> unmarshalling.
>
> Any help / suggestion would be appreciated.
>
> thanks
>
> rohit
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to