com.dyuproject.web.rest.consumer
Class SimpleParameterConsumer

java.lang.Object
  extended by com.dyuproject.web.rest.AbstractLifeCycle
      extended by com.dyuproject.web.rest.consumer.AbstractConsumer
          extended by com.dyuproject.web.rest.consumer.SimpleParameterConsumer
All Implemented Interfaces:
LifeCycle, ValidatingConsumer

public final class SimpleParameterConsumer
extends AbstractConsumer

Consumes request parameters and converts it to pojos.

Author:
David Yu
Date created:
Jan 18, 2009

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.dyuproject.web.rest.ValidatingConsumer
ValidatingConsumer.FieldValidator
 
Field Summary
static String DEFAULT_CONTENT_TYPE
           
static String DEFAULT_RESPONSE_CONTENT_TYPE
           
 
Fields inherited from class com.dyuproject.web.rest.consumer.AbstractConsumer
_contentType, _fieldParams, _httpMethod, _pojoClass
 
Fields inherited from interface com.dyuproject.web.rest.ValidatingConsumer
REQUEST_CONTENT_TYPE
 
Constructor Summary
SimpleParameterConsumer()
           
 
Method Summary
 Object consume(RequestContext rc)
           
static String generateDefaultPojoAttrName(Class<?> clazz)
           
protected  String getDefaultContentType()
           
protected  String getDefaultResponseContentType()
           
protected  void init()
           
 boolean merge(Object pojo, RequestContext rc)
           
 
Methods inherited from class com.dyuproject.web.rest.consumer.AbstractConsumer
getContentType, getDefaultErrorMsg, getDisplayField, getFieldParam, getFieldParams, getHttpMethod, getPojoClass, preConfigure
 
Methods inherited from class com.dyuproject.web.rest.AbstractLifeCycle
destroy, destroy, getWebContext, init, isDestroyed, isInitialized, newObjectInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.dyuproject.web.rest.LifeCycle
destroy, init
 

Field Detail

DEFAULT_CONTENT_TYPE

public static final String DEFAULT_CONTENT_TYPE
See Also:
Constant Field Values

DEFAULT_RESPONSE_CONTENT_TYPE

public static final String DEFAULT_RESPONSE_CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

SimpleParameterConsumer

public SimpleParameterConsumer()
Method Detail

generateDefaultPojoAttrName

public static String generateDefaultPojoAttrName(Class<?> clazz)

getDefaultContentType

protected String getDefaultContentType()
Specified by:
getDefaultContentType in class AbstractConsumer

getDefaultResponseContentType

protected String getDefaultResponseContentType()

init

protected void init()
Specified by:
init in class AbstractLifeCycle

merge

public boolean merge(Object pojo,
                     RequestContext rc)
              throws IOException,
                     ValidationException
Throws:
IOException
ValidationException

consume

public Object consume(RequestContext rc)
               throws IOException,
                      ValidationException
Throws:
IOException
ValidationException


Copyright © 2008-2013. All Rights Reserved.