com.esri.core.internal.value
Class ClassificationDef

java.lang.Object
  extended by com.esri.core.internal.value.ClassificationDef
Direct Known Subclasses:
ClassBreaksDefinition, UniqueValueDefinition

public class ClassificationDef
extends Object

This is the base class for classification definition classes used when requesting renderers from dynamic map services. This class provides a means of setting base symbols and color ramps to use in the requested renderer. Note that both the color ramp and base symbol are optional.

Classes based on this one should be used with the GenerateRendererTask#execute(String, ClassificationDef) or GenerateRendererTask#executeAsync(String, ClassificationDef, com.esri.core.map.CallbackListener) methods.


Field Summary
protected  String _type
           
 
Constructor Summary
ClassificationDef()
          Instantiates a new classification definition.
ClassificationDef(org.codehaus.jackson.JsonNode node)
          Instantiates a new classification definition from the given JsonNode.
 
Method Summary
 Symbol getBaseSymbol()
          Gets the base symbol that the requested renderer will base its symbols on.
 ColorRamp getColorRamp()
          Gets the color ramp that the requested renderer will use to set the symbol colors.
 void setBaseSymbol(Symbol baseSymbol)
          Sets the base symbol that the requested renderer will base its symbols on.
 void setColorRamp(ColorRamp colorRamp)
          Sets the color ramp that the requested renderer will use to set the symbol colors.
 String toJson()
          Convert this instance to a json string to allow it to be passed to a dynamic map service generateDataClasses REST endpoint.
protected  void toJson(org.codehaus.jackson.JsonGenerator node)
          This method is used by toJson() to turn this instance into a JSON string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_type

protected String _type
Constructor Detail

ClassificationDef

public ClassificationDef()
Instantiates a new classification definition.


ClassificationDef

public ClassificationDef(org.codehaus.jackson.JsonNode node)
Instantiates a new classification definition from the given JsonNode.

Parameters:
node - the node defining a classification definition
Method Detail

getBaseSymbol

public Symbol getBaseSymbol()
Gets the base symbol that the requested renderer will base its symbols on.

Returns:
the base symbol

setBaseSymbol

public void setBaseSymbol(Symbol baseSymbol)
Sets the base symbol that the requested renderer will base its symbols on.

Parameters:
baseSymbol - the base symbol to set

getColorRamp

public ColorRamp getColorRamp()
Gets the color ramp that the requested renderer will use to set the symbol colors.

Returns:
the color ramp

setColorRamp

public void setColorRamp(ColorRamp colorRamp)
Sets the color ramp that the requested renderer will use to set the symbol colors.

Parameters:
colorRamp - the color ramp to set

toJson

public String toJson()
              throws Exception
Convert this instance to a json string to allow it to be passed to a dynamic map service generateDataClasses REST endpoint.

Returns:
the JSON string
Throws:
Exception - the exception

toJson

protected void toJson(org.codehaus.jackson.JsonGenerator node)
               throws IOException,
                      org.codehaus.jackson.JsonGenerationException,
                      Exception
This method is used by toJson() to turn this instance into a JSON string.

This method should be overridden in subclasses to add their class data to the given JSON node. Note that this base class method should be called by the override.

Parameters:
node - the node to add fields to
Throws:
IOException - Signals that an I/O exception has occurred.
org.codehaus.jackson.JsonGenerationException - the json generation exception
Exception - the exception


Copyright © 2012. All Rights Reserved.