1 29 30 package com.caucho.quercus.function; 31 32 import com.caucho.quercus.env.Env; 33 import com.caucho.quercus.env.NullValue; 34 import com.caucho.quercus.env.StringValueImpl; 35 import com.caucho.quercus.env.Value; 36 import com.caucho.quercus.expr.Expr; 37 38 import java.net.URL ; 39 40 public class URLMarshal extends Marshal 41 { 42 public static final Marshal MARSHAL = new URLMarshal(); 43 44 public boolean isReadOnly() 45 { 46 return true; 47 } 48 49 public Object marshal(Env env, Expr expr, Class expectedClass) 50 { 51 return marshal(env, expr.eval(env), expectedClass); 52 } 53 54 public Object marshal(Env env, Value value, Class expectedClass) 55 { 56 return value.toJavaURL(env); 57 } 58 59 public Value unmarshal(Env env, Object value) 60 { 61 return env.wrapJava((URL )value); 62 } 63 } 64 | Popular Tags |