KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > soap > skeleton > ParameterMarshal


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.soap.skeleton;
31
32 import com.caucho.jaxb.skeleton.Property;
33
34 import javax.jws.WebParam;
35 import javax.xml.bind.JAXBException;
36 import javax.xml.bind.Marshaller;
37 import javax.xml.bind.Unmarshaller;
38 import javax.xml.namespace.QName JavaDoc;
39 import javax.xml.stream.XMLStreamException;
40 import javax.xml.stream.XMLStreamReader;
41 import javax.xml.stream.XMLStreamWriter;
42 import java.io.IOException JavaDoc;
43
44 abstract public class ParameterMarshal {
45   protected final int _arg;
46   protected final Property _property;
47   protected final QName JavaDoc _name;
48   protected final Marshaller _marshaller;
49   protected final Unmarshaller _unmarshaller;
50
51   protected ParameterMarshal(int arg, Property property, QName JavaDoc name,
52                              Marshaller marshaller, Unmarshaller unmarshaller)
53   {
54     _arg = arg;
55     _property = property;
56     _name = name;
57     _marshaller = marshaller;
58     _unmarshaller = unmarshaller;
59   }
60
61   static ParameterMarshal create(int arg,
62                                  Property property,
63                                  QName JavaDoc name,
64                                  WebParam.Mode mode,
65                                  Marshaller marshaller,
66                                  Unmarshaller unmarshaller)
67   {
68     switch (mode) {
69     case IN:
70       return new InParameterMarshal(arg, property, name,
71                                     marshaller, unmarshaller);
72     case OUT:
73       return new OutParameterMarshal(arg, property, name,
74                                      marshaller, unmarshaller);
75     default:
76       throw new UnsupportedOperationException JavaDoc();
77     }
78   }
79
80   public int getArg()
81   {
82     return _arg;
83   }
84
85   //
86
// client
87
//
88

89   public void serializeCall(XMLStreamWriter out, Object JavaDoc []args)
90     throws IOException JavaDoc, XMLStreamException, JAXBException
91   {
92   }
93
94   public Object JavaDoc deserializeReply(XMLStreamReader in)
95     throws IOException JavaDoc, XMLStreamException, JAXBException
96   {
97     return null;
98   }
99   
100   public void deserializeReply(XMLStreamReader in, Object JavaDoc[] args)
101     throws IOException JavaDoc, XMLStreamException, JAXBException
102   {
103   }
104
105   //
106
// server
107
//
108

109   public void deserializeCall(XMLStreamReader in, Object JavaDoc []args)
110     throws IOException JavaDoc, XMLStreamException, JAXBException
111   {
112   }
113
114   public void deserializeCallDefault(Object JavaDoc []args)
115   {
116   }
117
118   public void serializeReply(XMLStreamWriter out, Object JavaDoc ret)
119     throws IOException JavaDoc, XMLStreamException, JAXBException
120   {
121   }
122
123   public void serializeReply(XMLStreamWriter out, Object JavaDoc []args)
124     throws IOException JavaDoc, XMLStreamException, JAXBException
125   {
126   }
127 }
128
Popular Tags