com.dyuproject.web.rest.consumer
Class SimpleJSONConsumer

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.SimpleJSONConsumer
All Implemented Interfaces:
LifeCycle, ValidatingConsumer

public final class SimpleJSONConsumer
extends AbstractConsumer

Consumes json content and converts it to pojos.

Author:
David Yu
Date created:
Jan 18, 2009

Nested Class Summary
static class SimpleJSONConsumer.ValidatingPojoConvertor
           
static class SimpleJSONConsumer.ValidatingSetter
           
 
Nested classes/interfaces inherited from interface com.dyuproject.web.rest.ValidatingConsumer
ValidatingConsumer.FieldValidator
 
Field Summary
static String CACHE_KEY
           
static String DEFAULT_DISPATCHER_NAME
           
 
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
SimpleJSONConsumer()
           
 
Method Summary
 Object consume(RequestContext rc)
           
protected  String getDefaultContentType()
           
protected  void init()
           
 boolean merge(Object pojo, RequestContext rc)
           
static void setDefaultContentType(String defaultContentType)
           
 
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_DISPATCHER_NAME

public static final String DEFAULT_DISPATCHER_NAME
See Also:
Constant Field Values

CACHE_KEY

public static final String CACHE_KEY
Constructor Detail

SimpleJSONConsumer

public SimpleJSONConsumer()
Method Detail

setDefaultContentType

public static void setDefaultContentType(String defaultContentType)

getDefaultContentType

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

init

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

merge

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

consume

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


Copyright © 2008-2013. All Rights Reserved.