is it possible in case of null values replace target with empty.? This example will show how to check if a String is null or empty using java, guava and apache commons.If you are working with collections you should consider Effective Java Item 43: Return empty arrays or collections, not nulls. I say return because you can consider ((string null) ? "" : string) as a function that returns a String. You can replace the empty string with any other String of course.
Java String Replace Example.JSON Example With Jersey Jackson.