01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 jsx3.lang;
17:
18: import org.directwebremoting.ScriptBuffer;
19: import org.directwebremoting.proxy.ScriptProxy;
20: import org.directwebremoting.proxy.io.Context;
21:
22: /**
23: * @author Joe Walker [joe at getahead dot org]
24: * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
25: */
26: public class Object extends Context {
27: /**
28: * All reverse ajax proxies need context to work from
29: * @param parent The parent context
30: * @param extension The script to take us from the parent to this object
31: * @param scriptProxy The new script proxy
32: */
33: public Object(Context parent, String extension,
34: ScriptProxy scriptProxy) {
35: super (parent, extension, scriptProxy);
36: }
37:
38: /**
39: * If we need to execute a (drapgen generated) function that looks like a
40: * setter, but that returns some data we have a problem because DWR assumes
41: * that it is a getter and doesn't add the final ScriptBuffer, so this
42: * temporary function will do just that.
43: * This is a bit of a nasty hack that I hope we can get rid of
44: */
45: public void ignoreReturn() {
46: ScriptBuffer script = new ScriptBuffer();
47: script.appendScript(getContextPath().replaceFirst(".$", ";"));
48: getScriptProxy().addScript(script);
49: }
50: }
|