com.dyuproject.web.rest.consumer
Class AbstractConsumer

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

public abstract class AbstractConsumer
extends AbstractLifeCycle
implements ValidatingConsumer

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
protected  String _contentType
           
protected  Map<?,?> _fieldParams
           
protected  String _httpMethod
           
protected  Class<?> _pojoClass
           
 
Fields inherited from interface com.dyuproject.web.rest.ValidatingConsumer
REQUEST_CONTENT_TYPE
 
Constructor Summary
AbstractConsumer()
           
 
Method Summary
 String getContentType()
           
protected abstract  String getDefaultContentType()
           
static String getDefaultErrorMsg(String field)
           
static StringBuilder getDisplayField(String field)
           
protected  String getFieldParam(String name)
           
 Map<?,?> getFieldParams()
           
 String getHttpMethod()
           
 Class<?> getPojoClass()
           
 void preConfigure(String httpMethod, String contentType, Class<?> pojoClass, Map<?,?> fieldParams)
           
 
Methods inherited from class com.dyuproject.web.rest.AbstractLifeCycle
destroy, destroy, getWebContext, init, 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.ValidatingConsumer
consume, merge
 
Methods inherited from interface com.dyuproject.web.rest.LifeCycle
destroy, init
 

Field Detail

_httpMethod

protected String _httpMethod

_contentType

protected String _contentType

_pojoClass

protected Class<?> _pojoClass

_fieldParams

protected Map<?,?> _fieldParams
Constructor Detail

AbstractConsumer

public AbstractConsumer()
Method Detail

getPojoClass

public final Class<?> getPojoClass()

getFieldParams

public final Map<?,?> getFieldParams()

getHttpMethod

public final String getHttpMethod()
Specified by:
getHttpMethod in interface ValidatingConsumer

getContentType

public final String getContentType()
Specified by:
getContentType in interface ValidatingConsumer

preConfigure

public void preConfigure(String httpMethod,
                         String contentType,
                         Class<?> pojoClass,
                         Map<?,?> fieldParams)
Specified by:
preConfigure in interface ValidatingConsumer

getFieldParam

protected final String getFieldParam(String name)

getDefaultContentType

protected abstract String getDefaultContentType()

getDefaultErrorMsg

public static String getDefaultErrorMsg(String field)

getDisplayField

public static StringBuilder getDisplayField(String field)


Copyright © 2008-2013. All Rights Reserved.