com.bowstreet.builders.webapp.methods
Class JsonRestructureHandler

java.lang.Object
  extended by com.bowstreet.builders.webapp.methods.JsonRestructureHandler
All Implemented Interfaces:
RestructureFeedData

public class JsonRestructureHandler
extends java.lang.Object
implements RestructureFeedData

RestructureFeedData for REST Service Call builder to convert JSON to XML.

See Also:
JSONUtil, JSON2XMLHandlerImpl

Constructor Summary
JsonRestructureHandler()
           
 
Method Summary
 boolean canProcess(IXml feed)
          Specifies if this handler can process the specified feed.
 java.lang.String getName()
          Gets the Localized name for this handler, which is to be displayed in the Restructure Type input of the REST Service Call builder.
 IXml processDesigntimeFeed(IXml arg0)
          Performs the processing of the specified feed that is used at designtime to generate the result schema.
 IXml processRuntimeFeed(IXml feed)
          Performs the processing of the specified feed used at runtime.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonRestructureHandler

public JsonRestructureHandler()
Method Detail

canProcess

public boolean canProcess(IXml feed)
Specifies if this handler can process the specified feed. This is only called if restructure type is set to "Auto". Typically the handler will peek into the feed data to determine if it can process it.

Specified by:
canProcess in interface RestructureFeedData
Parameters:
feed - The raw feed data from the Rest Service Call.
Returns:
true if this handler wants to process the feed, else false.

getName

public java.lang.String getName()
Gets the Localized name for this handler, which is to be displayed in the Restructure Type input of the REST Service Call builder.
This is only called if restructure type is not set to "Auto".
You must override this method if you extend this and if the restructure type is not set to "Auto"

Specified by:
getName in interface RestructureFeedData
Returns:
The Localized name for this handler.

processDesigntimeFeed

public IXml processDesigntimeFeed(IXml arg0)
Performs the processing of the specified feed that is used at designtime to generate the result schema.
This implementation just calls the processRuntimeFeed(..) to do the processing.

Specified by:
processDesigntimeFeed in interface RestructureFeedData
Parameters:
feed - The raw feed data from the Rest Service Call.
Returns:
The processed feed, which can be a modified incoming feed, or a new XML version.

processRuntimeFeed

public IXml processRuntimeFeed(IXml feed)
Performs the processing of the specified feed used at runtime.
This implementation uses the JSONUtil.json2Xml(..) method to convert the JSON to XML. To perform a custom conversion you can extend this class and override the getConversionHandler(..) method.

Specified by:
processRuntimeFeed in interface RestructureFeedData
Parameters:
feed - The raw feed data from the Rest Service Call.
Returns:
The processed feed, which can be a modified incoming feed, or a new XML version.
See Also:
JSONUtil.json2Xml(String, JSON2XMLHandler), getConversionHandler()


Copyright © 2009 IBM. All Rights Reserved.