Hi Sumit,
There is not a problem to introduce a java mapping in a response of a ECC system, at least if you are not using a standard PI software component. You can set in the response Operation Mapping, two mappings, the first one the java mapping and the second one your current mapping.
Java Mapping example: Java Mapping: To change the encoding type or replacing special characters.
Regards.