Code example for Field

Methods: get, setAccessible

0
 
    try 
    { 
      Field reflectedBuf      = DbusEventSerializable.class.getDeclaredField("_buf");
      Field reflectedPosition = DbusEventSerializable.class.getDeclaredField("_position");
      reflectedBuf.setAccessible(true);
      reflectedPosition.setAccessible(true);
      buf = (ByteBuffer)reflectedBuf.get(event);
      pos = reflectedPosition.getInt(event);
    } 
    catch (Exception e)
    { 
      throw new InvalidEventException(e);
    } 
 
    return (version == 0)? new DbusEventV1(buf, pos) : new DbusEventV2(buf, pos);
  } 
 
  /** 
   * Toggles corrupted state of event.  Final event state is determined by 
   # incoming event and specified subfield of event.