atg.rest.input
Interface RestInputCustomizer

All Known Implementing Classes:
JSONInputCustomizer, RestInputCustomizerImpl, XMLInputCustomizer

public interface RestInputCustomizer

An interface to allow for customizing REST input.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> convertToMap(java.lang.Object pObject, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Converts the supplied object to a Map of parameters
 java.lang.String[] getAcceptableMimeTypes()
          An array of mimetypes which this input customizer can handle
 java.lang.Class<?> getContainerClass()
          Returns the class of the type of object used by this object customizer to represent input
 java.lang.String getEncoding()
          Returns the character encoding of the output
 java.lang.String getFormat()
          Returns an identifier for the format, like "xml" or "json"
 java.lang.Object instantiateObjectParameter(java.lang.Object pObject, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Instantiates an object from the formatted data in pObject
 boolean isValidTypeString(java.lang.String pData)
          Returns true if the pData string can be handled by the InputCustomizer, false otherwise
 java.lang.Object parseString(java.lang.String pData, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Parses the given String and creates the appropriate representation of the data
 java.lang.String[] splitMultipleStringsAtCharacter(java.lang.String pData, char pChar)
          Splits multiple strings of the input customizer's format at the specified character
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

getFormat

java.lang.String getFormat()
Returns an identifier for the format, like "xml" or "json"

Returns:
an identifier for the format, like "xml" or "json"

getAcceptableMimeTypes

java.lang.String[] getAcceptableMimeTypes()
An array of mimetypes which this input customizer can handle

Returns:
an array of mime types

getContainerClass

java.lang.Class<?> getContainerClass()
Returns the class of the type of object used by this object customizer to represent input

Returns:
the class of the type of object used by this object customizer to represent input

getEncoding

java.lang.String getEncoding()
Returns the character encoding of the output

Returns:
Returns the character encoding of the output

parseString

java.lang.Object parseString(java.lang.String pData,
                             DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                             throws RestException
Parses the given String and creates the appropriate representation of the data

Parameters:
pData - a String which contains the data stream
pRequest - the servlet request
pResponse - the servlet response
Returns:
an object representing the data from pData
Throws:
RestException - if the string cannot be parsed

convertToMap

java.util.Map<java.lang.String,java.lang.Object> convertToMap(java.lang.Object pObject,
                                                              DynamoHttpServletRequest pRequest,
                                                              DynamoHttpServletResponse pResponse)
                                                              throws RestException
Converts the supplied object to a Map of parameters

Parameters:
pObject - the object to convert
pRequest - the servlet request
pResponse - the servlet response
Returns:
a Map with the values
Throws:
RestException - if an error occurs

instantiateObjectParameter

java.lang.Object instantiateObjectParameter(java.lang.Object pObject,
                                            DynamoHttpServletRequest pRequest,
                                            DynamoHttpServletResponse pResponse)
                                            throws RestException
Instantiates an object from the formatted data in pObject

Parameters:
pObject - the formatted data
Returns:
the instantiated object
Throws:
RestException

isValidTypeString

boolean isValidTypeString(java.lang.String pData)
Returns true if the pData string can be handled by the InputCustomizer, false otherwise

Parameters:
pData - the string to test
Returns:
true if the pData string can be handled by the InputCustomizer, false otherwise

splitMultipleStringsAtCharacter

java.lang.String[] splitMultipleStringsAtCharacter(java.lang.String pData,
                                                   char pChar)
Splits multiple strings of the input customizer's format at the specified character

Parameters:
pData - the string to split
pChar - the character to split at
Returns:
a String array with each string