1 | |
package org.kuali.rice.core.cxf.interceptors; |
2 | |
|
3 | |
import org.apache.cxf.interceptor.Fault; |
4 | |
import org.apache.cxf.message.Message; |
5 | |
import org.apache.cxf.phase.AbstractPhaseInterceptor; |
6 | |
import org.apache.cxf.phase.Phase; |
7 | |
import org.kuali.rice.core.api.util.CollectionUtils; |
8 | |
|
9 | |
import java.lang.reflect.Field; |
10 | |
import java.util.Collection; |
11 | |
import java.util.Collections; |
12 | |
import java.util.List; |
13 | |
import java.util.Map; |
14 | |
import java.util.Set; |
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
@SuppressWarnings("unused") |
24 | |
public class ImmutableCollectionsInInterceptor extends AbstractPhaseInterceptor<Message> { |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
public ImmutableCollectionsInInterceptor() { |
30 | 0 | super(Phase.USER_LOGICAL); |
31 | 0 | } |
32 | |
|
33 | |
@Override |
34 | |
public void handleMessage(final Message message) throws Fault { |
35 | |
try { |
36 | 0 | List contents = message.getContent(List.class); |
37 | 0 | for (Object o : contents) { |
38 | 0 | CollectionUtils.makeUnmodifiableAndNullSafe(o); |
39 | |
} |
40 | 0 | } catch (IllegalAccessException e) { |
41 | 0 | throw new Fault(e); |
42 | 0 | } |
43 | 0 | } |
44 | |
} |