com.esri.core.internal.value
Class LayerLegendInfoCollection

java.lang.Object
  extended by com.esri.core.internal.value.LayerLegendInfoCollection

public class LayerLegendInfoCollection
extends Object

This class contains a collection of LayerLegendInfo instances with one for each sublayer of the layer that this class came from. An instance of this class can be created by calling fromJson(JsonParser, String) with the appropriate initialised JsonParser and a service URL. More usually though, an instance of this class will come from a call to getLegend() on a layer.


Method Summary
static LayerLegendInfoCollection fromJson(org.codehaus.jackson.JsonParser parser, String url)
          Create a new instance of this class with the given JsonParser.
 LayerLegendInfo getLayerLegendInfo(int layerId)
          Gets the layer legend info that corresponds to the given sublayer id.
 List<LayerLegendInfo> getLayerLegendInfos()
          Gets all the layer legend info instances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLayerLegendInfos

public List<LayerLegendInfo> getLayerLegendInfos()
Gets all the layer legend info instances

Returns:
the layer legend infos

getLayerLegendInfo

public LayerLegendInfo getLayerLegendInfo(int layerId)
Gets the layer legend info that corresponds to the given sublayer id.

Parameters:
layerId - the sublayer id
Returns:
the layer legend info or null if there is no match for the given ID.

fromJson

public static LayerLegendInfoCollection fromJson(org.codehaus.jackson.JsonParser parser,
                                                 String url)
                                          throws Exception
Create a new instance of this class with the given JsonParser. Ensure that the parser has been initialised with the correct JSON string.

Parameters:
parser - the parser initialised with JSON describing a service's legend information
url - the url of the service
Returns:
the layer legend info collection
Throws:
Exception - the exception


Copyright © 2012. All Rights Reserved.