01: package com.sun.xml.ws.client.sei;
02:
03: import com.sun.xml.ws.model.ParameterImpl;
04:
05: import javax.xml.ws.WebServiceException;
06:
07: /**
08: * {@link ValueSetterFactory} is used to create {@link ValueSetter}.
09: *
10: * @author Jitendra Kotamraju
11: */
12: abstract class ValueSetterFactory {
13:
14: abstract ValueSetter get(ParameterImpl p);
15:
16: static final ValueSetterFactory SYNC = new ValueSetterFactory() {
17: ValueSetter get(ParameterImpl p) {
18: return ValueSetter.getSync(p);
19: }
20: };
21:
22: static final ValueSetterFactory NONE = new ValueSetterFactory() {
23: ValueSetter get(ParameterImpl p) {
24: throw new WebServiceException(
25: "This shouldn't happen. No response parameters.");
26: }
27: };
28:
29: static final ValueSetterFactory SINGLE = new ValueSetterFactory() {
30: ValueSetter get(ParameterImpl p) {
31: return ValueSetter.SINGLE_VALUE;
32: }
33: };
34:
35: static final class AsyncBeanValueSetterFactory extends
36: ValueSetterFactory {
37: private Class asyncBean;
38:
39: AsyncBeanValueSetterFactory(Class asyncBean) {
40: this .asyncBean = asyncBean;
41: }
42:
43: ValueSetter get(ParameterImpl p) {
44: return new ValueSetter.AsyncBeanValueSetter(p, asyncBean);
45: }
46: }
47:
48: }
|