Type Conversion Rules

The table below lists the type conversion rules for reading a message property or a field from the message body of message types MapMessage and StreamMessage.

Any message property, map message key value or byte message field written as one of the types in the row can be read out as one of the types of the columns for which the cells are marked as Y. All the other cases will throw a JMSException. Please note that the cases for char and byte[] are not applicable for message properties. When a string is read as one of the primitives if the string value cannot be converted to the required type an appropriate instance of NumberFormatException will be thrown:

 

boolean

byte

byte[ ]

short

char

int

long

float

double

String

boolen

Y

        

Y

byte

 

Y

 

Y

 

Y

Y

  

Y

byte[ ]

Y

         

short

   

Y

 

Y

Y

  

Y

char

    

Y

    

Y

int

     

Y

Y

  

Y

long

      

Y

  

Y

float

       

Y

Y

Y

double

        

Y

Y

String

Y

Y

 

Y

 

Y

Y

Y

Y

Y



Professional JMS
Professional JMS
ISBN: 1861004931
EAN: 2147483647
Year: 2000
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net