|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Any decent documentation for the JAVA plugin classes? |
« View previous topic :: View next topic » |
Author |
Message
|
Deeko |
Posted: Wed Mar 20, 2002 12:38 am Post subject: |
|
|
 Acolyte
Joined: 16 May 2001 Posts: 72 Location: Edinburgh, UK
|
Hi,
I'm having fun coding a JAVA plugin! I'm having difficulty in coding to cope with the navigation of all children of a parent in the message tree though! The docs that are supplied and the JavaDoc aren't really that useful! Anyone got any "special" IBM documentation? My specific problem just now is that if I do:
MbElement Cursor = .....getFirstChild();
while (cursor.getName() != null)
{
...
cursor = cursor.getNextSibling();
}
Then I get a null pointer exception (on the getNextSibling call) when I get past the last child of the parent...
Help!
Regards,
Derek. |
|
Back to top |
|
 |
devans |
Posted: Wed Mar 20, 2002 1:18 am Post subject: |
|
|
Apprentice
Joined: 18 Mar 2002 Posts: 43
|
I believe that getNextSibling() returns 'null' if there is no sibling. The condition in your loop will be trying to call a method on a null reference which will cause your exception.
Try changing your code to say
while(cursor != null)
{
...
} |
|
Back to top |
|
 |
Deeko |
Posted: Wed Mar 20, 2002 3:08 am Post subject: |
|
|
 Acolyte
Joined: 16 May 2001 Posts: 72 Location: Edinburgh, UK
|
I'm sure I tried that...I'll give it a bash though!
Thanks,
Derek. |
|
Back to top |
|
 |
Deeko |
Posted: Wed Mar 20, 2002 3:33 am Post subject: |
|
|
 Acolyte
Joined: 16 May 2001 Posts: 72 Location: Edinburgh, UK
|
That worked! Thanks very much...
Regards,
Derek. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|