@Test public void itWorksForABasicExample() throws Exception { String stagePropertiesJsonString = "{\n" + " stageClass: \"" + TestStage.class.getName() + "\",\n" + " query: {\"touched\" : {\"extractTitles\" : true}, \"exists\" : {\"source\" : true} },\n" + " fieldValueMap: {\"source\": [\"value1\", \"value2\"] }\n" + "}"; TestStage stage = (TestStage) AbstractProcessStageMapper.fromJsonString(stagePropertiesJsonString); assertThat(stage.getQuery().getTouched().get("extractTitles"), equalTo(true)); assertThat(stage.getNumberOfThreads(), equalTo(1)); assertThat(stage.getFieldValueMap().get("source").get(0), equalTo("value1")); assertThat(stage.getNonEssentialField(), equalTo(null)); assertTrue("Stage was not initialized", stage.isInitialized()); }
public static AbstractProcessStage fromJsonString(String json) throws JsonException, ClassNotFoundException, InstantiationException, IllegalAccessException, InitFailedException, RequiredArgumentMissingException { Map<String, Object> properties = SerializationUtils.fromJson(json); return fromMap(properties); }
AbstractProcessStageMapper { public static AbstractProcessStage fromJsonString(String json) throws JsonException, ClassNotFoundException, InstantiationException, IllegalAccessException, InitFailedException, RequiredArgumentMissingException { Map<String, Object> properties = SerializationUtils.fromJson(json); return fromMap(properties); } }
AbstractProcessStageMapper { public static AbstractProcessStage fromJsonString(String json) throws JsonException, ClassNotFoundException, InstantiationException, IllegalAccessException, InitFailedException, RequiredArgumentMissingException { Map<String, Object> properties = SerializationUtils.fromJson(json); return fromMap(properties); }  }
AbstractProcessStageMapper { public static AbstractProcessStage fromJsonString(String json) throws JsonException, ClassNotFoundException, InstantiationException, IllegalAccessException, InitFailedException, RequiredArgumentMissingException { Map<String, Object> properties = SerializationUtils.fromJson(json); return fromMap(properties); }  static AbstractProcessStage fromJsonString(String json); static List<Field> getParameterFields(Object o); }
AbstractProcessStageMapper { public static AbstractProcessStage fromJsonString(String json) throws JsonException, ClassNotFoundException, InstantiationException, IllegalAccessException, InitFailedException, RequiredArgumentMissingException { Map<String, Object> properties = SerializationUtils.fromJson(json); return fromMap(properties); }  static AbstractProcessStage fromJsonString(String json); static List<Field> getParameterFields(Object o); static final String ARG_NAME_STAGE_CLASS; }