/** * Returns the default serializer for a class that isn't matched * directly. Application can override this method to produce * bean-style serialization instead of field serialization. * * @param cl the class of the object that needs to be serialized. * * @return a serializer object for the serialization. */ protected Deserializer getDefaultDeserializer(Class cl) { return new JavaDeserializer(cl); }
public Object readMap(AbstractHessianInput in) throws IOException { try { Object obj = instantiate(); return readMap(in, obj); } catch (IOException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(_type.getName() + ":" + e.getMessage(), e); } }
void deserialize(AbstractHessianInput in, Object obj) throws IOException { Object value = null; try { value = in.readObject(_field.getType()); _field.set(obj, value); } catch (Exception e) { logDeserializeError(_field, obj, value, e); } } }
public Object readObject(AbstractHessianInput in, String []fieldNames) throws IOException { try { Object obj = instantiate(); return readObject(in, obj, fieldNames); } catch (IOException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(_type.getName() + ":" + e.getMessage(), e); } }
public JavaDeserializer(Class<?> cl) _fieldMap = getFieldMap(cl); _readResolve = getReadResolve(cl); _constructorArgs = new Object[params.length]; for (int i = 0; i < params.length; i++) { _constructorArgs[i] = getParamArg(params[i]);
private Object readObject(AbstractHessianInput in, Object obj, FieldDeserializer []fields) throws IOException { try { int ref = in.addRef(obj); for (FieldDeserializer reader : fields) { reader.deserialize(in, obj); } Object resolve = resolve(in, obj); if (obj != resolve) in.setRef(ref, resolve); return resolve; } catch (IOException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(obj.getClass().getName() + ":" + e, e); } }
public Object readMap(AbstractHessianInput in) throws IOException { Object object = super.readMap(in); if (object instanceof AbstractQuery) { AbstractQuery abstractClientQuery = (AbstractQuery) object; Object root = abstractClientQuery.getRoot(); if (root instanceof Class) { ObjEntity entity = clientResolver.lookupObjEntity((Class) root); if (entity == null) { throw new CayenneRuntimeException("Unmapped client class: " + root); } abstractClientQuery.setRoot(entity.getName()); } } return object; } }
protected Object instantiate() throws Exception { if (constructor != null) return constructor.newInstance(new Object[1]); else return super.instantiate(); } }
public JavaDeserializer(Class cl) _fieldMap = getFieldMap(cl); _readResolve = getReadResolve(cl); _constructorArgs = new Object[params.length]; for (int i = 0; i < params.length; i++) { _constructorArgs[i] = getParamArg(params[i]);
@Override public Object readObject(AbstractHessianInput in, Object []fields) throws IOException { try { Object obj = instantiate(); return readObject(in, obj, (FieldDeserializer []) fields); } catch (IOException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(_type.getName() + ":" + e.getMessage(), e); } }
private Object readObject(AbstractHessianInput in, Object obj, FieldDeserializer []fields) throws IOException { try { int ref = in.addRef(obj); for (FieldDeserializer reader : fields) { reader.deserialize(in, obj); } Object resolve = resolve(in, obj); if (obj != resolve) in.setRef(ref, resolve); return resolve; } catch (IOException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(obj.getClass().getName() + ":" + e, e); } }
public Object readMap(AbstractHessianInput in) throws IOException { Object object = super.readMap(in); if (object instanceof AbstractQuery) { AbstractQuery abstractClientQuery = (AbstractQuery) object; Object root = abstractClientQuery.getRoot(); if (root instanceof Class) { ObjEntity entity = clientResolver.lookupObjEntity((Class) root); if (entity == null) { throw new CayenneRuntimeException("Unmapped client class: " + root); } abstractClientQuery.setRoot(entity.getName()); } } return object; } }
void deserialize(AbstractHessianInput in, Object obj) throws IOException { boolean value = false; try { value = in.readBoolean(); _field.setBoolean(obj, value); } catch (Exception e) { logDeserializeError(_field, obj, value, e); } } }
public JavaDeserializer(Class<?> cl) _fieldMap = getFieldMap(cl); _readResolve = getReadResolve(cl); _constructorArgs = new Object[params.length]; for (int i = 0; i < params.length; i++) { _constructorArgs[i] = getParamArg(params[i]);
@Override public Object readObject(AbstractHessianInput in, String []fieldNames) throws IOException { try { Object obj = instantiate(); return readObject(in, obj, fieldNames); } catch (IOException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(_type.getName() + ":" + e.getMessage(), e); } }
public Object readMap(AbstractHessianInput in) throws IOException { try { Object obj = instantiate(); return readMap(in, obj); } catch (IOException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(_type.getName() + ":" + e.getMessage(), e); } }
/** * Returns the default serializer for a class that isn't matched * directly. Application can override this method to produce * bean-style serialization instead of field serialization. * * @param cl the class of the object that needs to be serialized. * * @return a serializer object for the serialization. */ protected Deserializer getDefaultDeserializer(Class cl) { if (InputStream.class.equals(cl)) return InputStreamDeserializer.DESER; return new JavaDeserializer(cl); }
private Object readObject(AbstractHessianInput in, Object obj, FieldDeserializer[] fields) throws IOException { try { int ref = in.addRef(obj); for (FieldDeserializer reader : fields) { reader.deserialize(in, obj); } Object resolve = resolve(in, obj); if (obj != resolve) in.setRef(ref, resolve); return resolve; } catch (IOException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(obj.getClass().getName() + ":" + e, e); } }
void deserialize(AbstractHessianInput in, Object obj) throws IOException { long value = 0; try { value = in.readLong(); _field.setLong(obj, value); } catch (Exception e) { logDeserializeError(_field, obj, value, e); } } }
public JavaDeserializer(Class<?> cl) _fieldMap = getFieldMap(cl); _readResolve = getReadResolve(cl); _constructorArgs = new Object[params.length]; for (int i = 0; i < params.length; i++) { _constructorArgs[i] = getParamArg(params[i]);