Esri Geoportal Server
1.2.9

com.esri.gpt.catalog.gxe
Class GxeJsonSerializer

java.lang.Object
  extended by com.esri.gpt.catalog.gxe.GxeJsonSerializer

public class GxeJsonSerializer
extends Object

Serializes a Geoportal XML editor definition to JSON format.


Constructor Summary
GxeJsonSerializer()
          Default constructor
 
Method Summary
 String asJson(GxeContext context, GxeDefinition definition)
          Returns a JSON representation for a Geoportal XML editor definition.
protected  String evaluateNodeValue(GxeContext context, XmlNode xmlNode, String value)
          Evaluates a GXE XmlNode value.
protected  List<XmlAttribute> getAttributesToRender(GxeContext context, XmlElement element)
          Gets the list of attributes to render.
protected  List<XmlElement> getChildrenToRender(GxeContext context, XmlElement element)
          Gets the list of children to render.
protected  String lookupI18N(GxeContext context, String i18nKey, XmlNode xmlNode, String originalValue)
          Looks up an I18N (internationalization and localization) message.
 void toJson(GxeContext context, XmlElement element, PrintWriter writer, int depth, boolean isLast)
          Writes a JSON representation of the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GxeJsonSerializer

public GxeJsonSerializer()
Default constructor

Method Detail

asJson

public String asJson(GxeContext context,
                     GxeDefinition definition)
              throws IOException
Returns a JSON representation for a Geoportal XML editor definition.

Parameters:
context - the processing context
definition - the definition to be serialized
Returns:
the JSON string
Throws:
IOException - if an exception occurs

evaluateNodeValue

protected String evaluateNodeValue(GxeContext context,
                                   XmlNode xmlNode,
                                   String value)
Evaluates a GXE XmlNode value.

Parameters:
context - the processing context
xmlNode - the GXE XmlNode that is actively being processed
value - the node value to evaluate
Returns:
the evaluated node value

getAttributesToRender

protected List<XmlAttribute> getAttributesToRender(GxeContext context,
                                                   XmlElement element)
Gets the list of attributes to render.

Parameters:
context - the processing context
element - the GXE XmlElement that is actively being processed
Returns:
the list to render

getChildrenToRender

protected List<XmlElement> getChildrenToRender(GxeContext context,
                                               XmlElement element)
Gets the list of children to render.

Parameters:
context - the processing context
element - the GXE XmlElement that is actively being processed
Returns:
the list to render

lookupI18N

protected String lookupI18N(GxeContext context,
                            String i18nKey,
                            XmlNode xmlNode,
                            String originalValue)
Looks up an I18N (internationalization and localization) message.

Parameters:
context - the processing context
i18nKey - the resource bundle key
xmlNode - the GXE XmlNode that is actively being processed
originalValue - the original node value
Returns:
the I18N message

toJson

public void toJson(GxeContext context,
                   XmlElement element,
                   PrintWriter writer,
                   int depth,
                   boolean isLast)
            throws IOException
Writes a JSON representation of the property.

Parameters:
context - the processing context
element - the GXE element that is actively being processed
writer - the writer
depth - the depth of the parent
isLast - trueThrows:
IOException - if an I/O exception occurs

Esri Geoportal Server
1.2.9

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.