atg.rest.input
Class RestInputCustomizerImpl

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.rest.input.RestInputCustomizerImpl
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, RestInputCustomizer, java.util.EventListener
Direct Known Subclasses:
JSONInputCustomizer, XMLInputCustomizer

public abstract class RestInputCustomizerImpl
extends GenericService
implements RestInputCustomizer

An abstract class which implements functionality common to input customizers.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static char SPACE
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RestInputCustomizerImpl()
          Constructor
 
Method Summary
 java.lang.String[] getAcceptableMimeTypes()
          Returns an array of allowable mimeTypes which this input customizer can handle
 java.lang.String getEncoding()
          Gets the Character encoding which defaults to UTF-8
 java.lang.String getFormat()
          Returns the format for the input customizer, for example "json" or "xml"
static RestInputCustomizer getInputCustomizer(java.lang.Class pClass)
          Returns the input customer which can handle the given object class type
static RestInputCustomizer getInputCustomizer(java.lang.String pMimeType)
          Returns the input customer which can handle the given mime type
 java.lang.String getMapKeyElementString()
          The string to use for map key tags
 java.lang.String getMapValueElementString()
          The string to use for map value tags
protected  java.lang.Object javaInstanceForClass(java.lang.String pClassName, DynamoHttpServletResponse pResponse)
          for a given json object, return a java object instance
 void setAcceptableMimeTypes(java.lang.String[] pAcceptableMimeTypes)
          Sets the array of allowable mimeTypes which this input customizer can handle
 void setEncoding(java.lang.String pEncoding)
          Sets the Character encoding to be used for input
protected  void setFormat(java.lang.String pFormat)
          Sets the format for the input customizer
 void setMapKeyElementString(java.lang.String pMapKeyElementString)
          Sets the string to use for map key tags
 void setMapValueElementString(java.lang.String pMapValueElementString)
          Sets the string to use for map value tags
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface atg.rest.input.RestInputCustomizer
convertToMap, getContainerClass, instantiateObjectParameter, isValidTypeString, parseString, splitMultipleStringsAtCharacter
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


SPACE

protected static final char SPACE
See Also:
Constant Field Values
Constructor Detail

RestInputCustomizerImpl

public RestInputCustomizerImpl()
Constructor

Method Detail

getFormat

public java.lang.String getFormat()
Returns the format for the input customizer, for example "json" or "xml"

Specified by:
getFormat in interface RestInputCustomizer
Returns:
the value of format

setFormat

protected void setFormat(java.lang.String pFormat)
Sets the format for the input customizer

Parameters:
pFormat - the format to set

getAcceptableMimeTypes

public java.lang.String[] getAcceptableMimeTypes()
Returns an array of allowable mimeTypes which this input customizer can handle

Specified by:
getAcceptableMimeTypes in interface RestInputCustomizer
Returns:
the value of acceptableMimeTypes

setAcceptableMimeTypes

public void setAcceptableMimeTypes(java.lang.String[] pAcceptableMimeTypes)
Sets the array of allowable mimeTypes which this input customizer can handle

Parameters:
pAcceptableMimeTypes - the acceptableMimeTypes to set

getMapKeyElementString

public java.lang.String getMapKeyElementString()
The string to use for map key tags

Returns:
the mapKeyElementString

setMapKeyElementString

public void setMapKeyElementString(java.lang.String pMapKeyElementString)
Sets the string to use for map key tags

Parameters:
pMapKeyElementString - the mapKeyElementString to set

getMapValueElementString

public java.lang.String getMapValueElementString()
The string to use for map value tags

Returns:
the mapValueElementString

setMapValueElementString

public void setMapValueElementString(java.lang.String pMapValueElementString)
Sets the string to use for map value tags

Parameters:
pMapValueElementString - the mapValueElementString to set

getEncoding

public java.lang.String getEncoding()
Gets the Character encoding which defaults to UTF-8

Specified by:
getEncoding in interface RestInputCustomizer
Returns:
character encoding

setEncoding

public void setEncoding(java.lang.String pEncoding)
Sets the Character encoding to be used for input

Parameters:
pEncoding - character encoding

getInputCustomizer

public static RestInputCustomizer getInputCustomizer(java.lang.String pMimeType)
Returns the input customer which can handle the given mime type

Parameters:
pMimeType - the mime type
Returns:
a RestInputCustomizer which can handle the given mimetype

getInputCustomizer

public static RestInputCustomizer getInputCustomizer(java.lang.Class pClass)
Returns the input customer which can handle the given object class type

Parameters:
pClass - a container class such as JSONObject or Document
Returns:
a RestInputCustomizer which uses the given class type as a container

javaInstanceForClass

protected java.lang.Object javaInstanceForClass(java.lang.String pClassName,
                                                DynamoHttpServletResponse pResponse)
                                         throws RestException
for a given json object, return a java object instance

Parameters:
pClassName - the class name for the object to instantiate
pResponse - the response object
Returns:
a java object of the specified class type
Throws:
RestException