Re: [Simple-support] how to determine where in the xml file/stream anexception is thrown?
Brought to you by:
niallg
|
From: <Nia...@ub...> - 2009-02-11 13:50:13
|
Hi, You can do this in a few ways, the simples of which is to use a Strategy to grab the line number from the NodeMap. For convenience you could put it in to a thread local then any method invoked in your object can get the last position reference from the thread local and throw that without you having to do anything. There are examples in the test cases, look for tests with Strategy in them. Niall -----Original Message----- From: Lawrence Sewell [mailto:Law...@vt...] Sent: 10 February 2009 21:33 To: sim...@li... Subject: [Simple-support] how to determine where in the xml file/stream anexception is thrown? If I throw an exception in a "setSomething" method, how can I determine where in the XML stream the exception occurred (e.g. the StAX cursor location)? Is this info available in a Validate method? In SAX this is the Locator object and its getLineNumber() and getColumnNumber() methods. ------------------------------------------------------------------------ ------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. UBS Limited is a company registered in England & Wales under company number 2035362, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS AG (London Branch) is registered as a branch of a foreign company under number BR004507, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS Clearing and Execution Services Limited is a company registered in England & Wales under company number 03123037, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. |