@Override public JsonObject convert(IFeatureRenderer renderer){
  ScaleDependentRenderer scaleDependentRenderer=(ScaleDependentRenderer)renderer;
  logger.info(ScaleDependentRendererKeys.SCALE_DEPENDENT_RENDERER);
  int index=-1;
  try {
    JsonObject jsonObject=new JsonObject();
    JsonObject rendererObject=new JsonObject();
    JsonArray rendererArray=new JsonArray();
    rendererObject.addProperty(ScaleDependentRendererKeys.GRADUATED_SYMBOLS,scaleDependentRenderer.isSymbolsAreGraduated());
    for (index=0; index < scaleDependentRenderer.getRendererCount(); index++) {
      JsonObject jsonValueObject=new JsonObject();
      try {
        double breakValue=scaleDependentRenderer.getBreak(index);
        jsonValueObject.addProperty(ScaleDependentRendererKeys.BREAK,breakValue);
      }
 catch (      AutomationException e) {
      }
      try {
        JsonElement rendererElement=ParseLayer.createRenderer((IFeatureRenderer)scaleDependentRenderer.getRenderer(index));
        if (rendererElement != null) {
          jsonValueObject.add(ScaleDependentRendererKeys.RENDERER,rendererElement);
        }
      }
 catch (      AutomationException e) {
      }
      rendererArray.add(jsonValueObject);
    }
    rendererObject.add(ScaleDependentRendererKeys.RENDERER_LISTS,rendererArray);
    jsonObject.add(ScaleDependentRendererKeys.SCALE_DEPENDENT_RENDERER,rendererObject);
    return jsonObject;
  }
 catch (  AutomationException e) {
    logger.error(String.format("ClassBreaksRender index : %d",index));
    e.printStackTrace();
    logger.error(e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    logger.error(e.getMessage());
  }
  return null;
}

@ Override public JsonObject convert ( IFeatureRenderer renderer ) { ScaleDependentRenderer scaleDependentRenderer = ( ScaleDependentRenderer ) renderer ; logger . info ( ScaleDependentRendererKeys . SCALE_DEPENDENT_RENDERER ) ; int index = - 1 ; try { JsonObject jsonObject = new JsonObject ( ) ; JsonObject rendererObject = new JsonObject ( ) ; JsonArray rendererArray = new JsonArray ( ) ; rendererObject . addProperty ( ScaleDependentRendererKeys . GRADUATED_SYMBOLS , scaleDependentRenderer . isSymbolsAreGraduated ( ) ) ; for ( index = 0 ; index < scaleDependentRenderer . getRendererCount ( ) ; index ++ ) { JsonObject jsonValueObject = new JsonObject ( ) ; try { double breakValue = scaleDependentRenderer . getBreak ( index ) ; jsonValueObject . addProperty ( ScaleDependentRendererKeys . BREAK , breakValue ) ; } catch ( AutomationException e ) { } try { JsonElement rendererElement = ParseLayer . createRenderer ( ( IFeatureRenderer ) scaleDependentRenderer . getRenderer ( index ) ) ; if ( rendererElement != null ) { jsonValueObject . add ( ScaleDependentRendererKeys . RENDERER , rendererElement ) ; } } catch ( AutomationException e ) { } rendererArray . add ( jsonValueObject ) ; } rendererObject . add ( ScaleDependentRendererKeys . RENDERER_LISTS , rendererArray ) ; jsonObject . add ( ScaleDependentRendererKeys . SCALE_DEPENDENT_RENDERER , rendererObject ) ; return jsonObject ; } catch ( AutomationException e ) { logger . error ( String . format ( "ClassBreaksRender index : %d" , index ) ) ; e . printStackTrace ( ) ; logger . error ( e . getMessage ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; logger . error ( e . getMessage ( ) ) ; } return null ; }
convert class breaks renderer .
