test_class.declarator: extractor
test_class.modifier: private
test_class.original_string: private DateExtractor extractor;
test_class.type: DateExtractor
test_class.var_name: extractor
test_class.declarator: converter
test_class.modifier: private
test_class.original_string: private ObjectToJsonConverter converter;
test_class.type: ObjectToJsonConverter
test_class.var_name: converter
test_class.file: agent/core/src/test/java/org/jolokia/converter/json/DateExtractorTest.java
test_class.identifier: DateExtractorTest
test_case.body: @Test
      public void timeSet() throws InvocationTargetException, IllegalAccessException {
          Date date = new Date();
          long currentTime = date.getTime();
          Object oldVal = extractor.setObjectValue(null,date,"time",0L);
          assertEquals(oldVal,currentTime);
          assertEquals(date.getTime(),0L);
  
          oldVal = extractor.setObjectValue(null,date,"time","1000");
          assertEquals(oldVal,0L);
          assertEquals(date.getTime(),1000L);
      }
test_case.class_method_signature: DateExtractorTest.timeSet()
test_case.full_signature: @Test public void timeSet()
test_case.identifier: timeSet
test_case.invocations: getTime setObjectValue assertEquals assertEquals getTime setObjectValue assertEquals assertEquals getTime
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void timeSet()
focal_class.file: agent/core/src/main/java/org/jolokia/converter/json/DateExtractor.java
focal_class.identifier: DateExtractor
focal_class.interfaces: implements Extractor
focal_class.class_method_signature: DateExtractor.getType()
focal_class.full_signature: public Class getType()
focal_class.identifier: getType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Class
focal_class.signature: Class getType()
focal_class.class_method_signature: DateExtractor.extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify)
focal_class.full_signature: public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify)
focal_class.identifier: extractObject
focal_class.modifiers: public
focal_class.parameters: (ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify)
focal_class.return: Object
focal_class.signature: Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify)
focal_class.class_method_signature: DateExtractor.setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_class.full_signature: public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_class.identifier: setObjectValue
focal_class.modifiers: public
focal_class.parameters: (StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_class.return: Object
focal_class.signature: Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_class.class_method_signature: DateExtractor.canSetValue()
focal_class.full_signature: public boolean canSetValue()
focal_class.identifier: canSetValue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean canSetValue()
focal_method.body: public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
              throws IllegalAccessException, InvocationTargetException {
          Date date = (Date) pInner;
          if ("time".equals(pAttribute)) {
              long time;
              long oldValue = date.getTime();
              if (pValue instanceof String) {
                  time = Long.parseLong((String) pValue);
              } else {
                  time = (Long) pValue;
              }
              date.setTime(time);
              return oldValue;
          } else if ("iso8601".equals(pAttribute)) {
              Date newDate = DateUtil.fromISO8601(pValue.toString());
              String oldValue = DateUtil.toISO8601(date);
              date.setTime(newDate.getTime());
              return oldValue;
          }
          throw new UnsupportedOperationException("Setting of date values is not yet supported directly. " +
                                                          "Use a path/attribute 'time' to set the epoch seconds on a date");
      }
focal_method.class_method_signature: DateExtractor.setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_method.full_signature: public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_method.identifier: setObjectValue
focal_method.invocations: equals getTime parseLong setTime equals fromISO8601 toString toISO8601 setTime getTime
focal_method.modifiers: public
focal_method.parameters: (StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)
focal_method.return: Object
focal_method.signature: Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue)