if (parameter instanceof ObjectPath) { parameter = ((ObjectPath) parameter).conn.getExportedObject( ((ObjectPath) parameter).source, ((ObjectPath) parameter).path); }
   static Object deSerializeParameter(Object parameter, Type type) throws Exception   {      if (null == parameter)          return null;      // its a wrapped variant, unwrap it      if (type instanceof TypeVariable             && parameter instanceof Variant) {         parameter = ((Variant)parameter).getValue();      }      // its a wrapped map, unwrap it      if (parameter instanceof MapContainer)         parameter = ((MapContainer) parameter).getMap(type);      // its a wrapped list, unwrap it      if (parameter instanceof ListContainer) {         parameter = ((ListContainer) parameter).getList(type);      }      // it should be a struct. create it      if (parameter instanceof Object[] &&             type instanceof Class &&            Struct.class.isAssignableFrom((Class) type)) {         Type[] ts = Struct.getStructTypeCache(type);         if (null == ts) {            Field[] fs = ((Class) type).getDeclaredFields();            ts = new Type[fs.length];            for (Field f : fs) {               Position p = f.getAnnotation(Position.class);               if (null == p) continue;               ts[p.value()] = f.getGenericType();           }            Struct.putStructTypeCache(type, ts);         }         // recurse over struct contents         parameter = deSerializeParameters((Object[]) parameter, ts);         for (Constructor con: ((Class) type).getDeclaredConstructors()) {            try {               parameter = con.newInstance((Object[]) parameter);               break;            } catch (IllegalArgumentException IAe) {}         }      }      // recurse over arrays      if (parameter instanceof Object[]) {         Type[] ts = new Type[((Object[]) parameter).length];         Arrays.fill(ts, parameter.getClass().getComponentType());         parameter = deSerializeParameters((Object[]) parameter,               ts);      }      // make sure arrays are in the correct format      if (parameter instanceof Object[] ||            parameter instanceof List ||            parameter.getClass().isArray()) {         if (type instanceof ParameterizedType)            parameter = ArrayFrob.convert(parameter,                  (Class<? extends Object>) ((ParameterizedType) type).getRawType());         else if (type instanceof GenericArrayType) {            Type ct = ((GenericArrayType) type).getGenericComponentType();            Class cc = null;            if (ct instanceof Class)               cc = (Class) ct;            if (ct instanceof ParameterizedType)               cc = (Class) ((ParameterizedType) ct).getRawType();            Object o = Array.newInstance(cc, 0);            parameter = ArrayFrob.convert(parameter,                  o.getClass());         } else if (type instanceof Class &&               ((Class) type).isArray()) {            Class cc = ((Class) type).getComponentType();            Object o = Array.newInstance(cc, 0);            parameter = ArrayFrob.convert(parameter,                  o.getClass());         }      }      return parameter;   }