KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > uk > ltd > getahead > dwr > compat > BaseV10Converter


1 /*
2  * Copyright 2005 Joe Walker
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package uk.ltd.getahead.dwr.compat;
17
18 import org.directwebremoting.extend.Converter;
19 import org.directwebremoting.extend.MarshallException;
20 import org.directwebremoting.extend.OutboundContext;
21 import org.directwebremoting.extend.OutboundVariable;
22
23 /**
24  * WARNING: This is not properly implemented yet.
25  * A way to migrate from the DWRv1.x Converter style to something in the future.
26  * Inheriting from this is advised to help with forwards compatibility.
27  * @author Joe Walker [joe at getahead dot ltd dot uk]
28  * @noinspection AbstractClassNeverImplemented
29  */

30 public abstract class BaseV10Converter implements Converter
31 {
32     /* (non-Javadoc)
33      * @see uk.ltd.getahead.dwr.Converter#convertOutbound(java.lang.Object, uk.ltd.getahead.dwr.OutboundContext)
34      */

35     public OutboundVariable convertOutbound(Object JavaDoc data, OutboundContext outctx) throws MarshallException
36     {
37         // We'll implement this properly if someone needs it
38
/*
39         OutboundVariable ov = new SimpleOutboundVariable();
40         outctx.put(data, ov);
41
42         String assignCode = outctx.getNextVariableName();
43
44         ov.setAssignCode(assignCode);
45         ov.setBuildCode(convertOutbound(data, ov.getAssignCode(), outctx));
46         ov.setRecursive(true);
47
48         return ov;
49         */

50
51         return null;
52     }
53
54     /**
55      * @see Converter#convertOutbound(Object, OutboundContext)
56      * @param varname The name of the variable to declare
57      * @param data The data to convert
58      * @param outctx Objects already converted and the results
59      * @return The OutboundVariable that represents the data to convert
60      * @throws MarshallException If the conversion failed for some reason
61      */

62     public abstract String JavaDoc convertOutbound(Object JavaDoc data, String JavaDoc varname, OutboundContext outctx) throws MarshallException;
63 }
64
Popular Tags