code: public static String geometryToJson(SpatialReference spatialReference,
  			Geometry geometry) {
  		OperatorExportToJson exporter = (OperatorExportToJson) factory
  				.getOperator(Operator.Type.ExportToJson);
  
  		return exporter.execute(spatialReference, geometry);
  	}
docs: Exports the specified geometry instance to it's JSON representation. M
  and Z values are not imported from JSON representation.
  
  See OperatorExportToJson.
  
  @param spatialReference
  The spatial reference of associated object.
  @param geometry
  The geometry.
  @return The JSON representation of the specified geometry.