public <BeanType extends ConfiguredBean>String saveBeanToJSON(final BeanType bean) throws ConfigException {
  try {
    final String str=jsonMapper.writeValueAsString(bean);
    return str;
  }
 catch (  final Exception e) {
    throw new ConfigException("Failed to serialize bean: " + bean,e);
  }
}

public < BeanType extends ConfiguredBean > String saveBeanToJSON ( final BeanType bean ) throws ConfigException { try { final String str = jsonMapper . writeValueAsString ( bean ) ; return str ; } catch ( final Exception e ) { throw new ConfigException ( "Failed to serialize bean: " + bean , e ) ; } }
serializes the bean to json .
