cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping

Former Member
0 Kudos

Hi,

I am doing a poc Java Mapping. The problem iam facing is that if i give an empty input value iam getting null pointer excepiton. So please help in this. How can i get the empty string input value in java mapping?

Regards,

Murugavel.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member187563
Contributor
0 Kudos

hi,

There must be some problem with your java code,because if you are using sax or dom parser properly then there should not be any problem with null values.

For example if you look into these codes

its working fine even with null values,You try to check your code with these

regards,

ujjwal kumar

Former Member
0 Kudos

Murugavel,

Could you please explain in little more detail the error condition?

Are you passing an empty value or a NULL value. Possibly you could check for the length of the input before performing any operations on it.

Thanks,

Anand

Former Member
0 Kudos

Hi,

I am not giving any input value. If i give any input means it is processing well but if i didnot give means the errror is being thrown. so i want to process the input wat ever it is. If it is null i want the target to be null, if it has a value then i want the value as it is in target. Please help me in this.

Regards,

Murugavel.

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

>> If it is null i want the target to be null,

In the mapping before performing any string operation on that field first check if it is null then return a null value else do the string operation that needs to be performed on that field. This avoids the exception.

For checking if the field is null u can.

1. Check if the length of the field > 0.

2. Chech if the filed == null.

Thanks

SaNv...

santhosh_kumarv
Active Contributor
0 Kudos

>>The problem iam facing is that if i give an empty input value iam getting null pointer excepiton

Is the empty input value is as the file level i.e empty file or at the field leve i.e empty field.

also be more specific of your requirement.

Thanks

SaNv...

former_member859847
Active Contributor
0 Kudos

Hi,

I hope, you are passing null value.

i.e u are not populating any data to particulat field.

pls check it.

warm regards

mahesh.