private static void configureObject(JsonNode document, ExternalConfigurationModel model)
      throws InvalidConfigurationException {

    String classname = StreamAggregatorUtils.readValueAsString(document, "class");
    if (classname == null || classname.equals(""))
      throw new InvalidConfigurationException(
          "Cannot configure an Aggregator which uses Object based data extraction without a 'class' configuration item");

    try {
      model.setClazz(Class.forName(classname));
    } catch (ClassNotFoundException e) {
      throw new InvalidConfigurationException(
          String.format("ClassNotFoundException: %s not found on Classpath", classname));
    }

    // try to load the class using its annotations
    try {
      AnnotationProcessor p = new AnnotationProcessor(model.getClazz());
      model.setAnnotatedClass(true);
    } catch (ClassNotAnnotatedException e) {
      // no problem
    } catch (Exception e) {
      throw new InvalidConfigurationException(e);
    }
  }