Esempio n. 1
0
  public Object readObject(AbstractHessianInput in, Object obj, String[] fieldNames)
      throws IOException {
    try {
      int ref = in.addRef(obj);

      for (int i = 0; i < fieldNames.length; i++) {
        String name = fieldNames[i];

        FieldDeserializer deser = (FieldDeserializer) _fieldMap.get(name);

        if (deser != null) deser.deserialize(in, obj);
        else in.readObject();
      }

      Object resolve = resolve(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);
    }
  }
Esempio n. 2
0
    void deserialize(AbstractHessianInput in, Object obj) throws IOException {
      String value = null;

      try {
        value = in.readString();

        _field.set(obj, value);
      } catch (Exception e) {
        logDeserializeError(_field, obj, value, e);
      }
    }
Esempio n. 3
0
    void deserialize(AbstractHessianInput in, Object obj) throws IOException {
      double value = 0;

      try {
        value = in.readDouble();

        _field.setDouble(obj, value);
      } catch (Exception e) {
        logDeserializeError(_field, obj, value, e);
      }
    }
Esempio n. 4
0
    void deserialize(AbstractHessianInput in, Object obj) throws IOException {
      int value = 0;

      try {
        value = in.readInt();

        _field.setShort(obj, (short) value);
      } catch (Exception e) {
        logDeserializeError(_field, obj, value, e);
      }
    }
Esempio n. 5
0
    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);
      }
    }
Esempio n. 6
0
    void deserialize(AbstractHessianInput in, Object obj) throws IOException {
      java.sql.Time value = null;

      try {
        java.util.Date date = (java.util.Date) in.readObject();
        value = new java.sql.Time(date.getTime());

        _field.set(obj, value);
      } catch (Exception e) {
        logDeserializeError(_field, obj, value, e);
      }
    }
Esempio n. 7
0
  public Object readMap(AbstractHessianInput in, Object obj) throws IOException {
    try {
      int ref = in.addRef(obj);

      while (!in.isEnd()) {
        Object key = in.readObject();

        FieldDeserializer deser = (FieldDeserializer) _fieldMap.get(key);

        if (deser != null) deser.deserialize(in, obj);
        else in.readObject();
      }

      in.readMapEnd();

      Object resolve = resolve(obj);

      if (obj != resolve) in.setRef(ref, resolve);

      return resolve;
    } catch (IOException e) {
      throw e;
    } catch (Exception e) {
      throw new IOExceptionWrapper(e);
    }
  }