com.bowstreet.builders.webapp.methods
Interface RestructureFeedData

All Known Implementing Classes:
JsonRestructureHandler

public interface RestructureFeedData

Interface used to restructure feed data from a Rest Service Call builder.
This is used during schema generation to determine the shape of the data, and at runtime to change the data into the desired structure.
Each handler must implement this interface.
To register a new handler that implements this interface you must add a property file to the WEB-INF\config\rest_handlers directory. The property file must contain the following properties:
auto - Specifies if the handler will participate in the "Auto" type restructure handler.
If true the canProcess(..) method will be called to check if this class is suitable for restructuring the specified feed.
If false the handler will be placed in the list of "Restructure Type" names using the getName(..) method as the label.
class.name - Specifies the handler class that implements this interface.

Example:
auto=false
class.name=com.bowstreet.samples.SampleRestructurea

Note - If you make changes to your rest_handlers property file and you are not running from the Designer you must re-deploy the war to pickup any changes.


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 feed)
          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.
 

Method Detail

canProcess

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.

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

getName

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".

Returns:
The Localized name for this handler.

processDesigntimeFeed

IXml processDesigntimeFeed(IXml feed)
Performs the processing of the specified feed that is used at designtime to generate the result schema.
The implementation method should modify the incoming feed or create a new one so that that it represents the structure that will be returned by processRuntimeFeed(IXml).

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

IXml processRuntimeFeed(IXml feed)
Performs the processing of the specified feed used at runtime.

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.


Copyright © 2009 IBM. All Rights Reserved.