org.picocontainer.web
Class IntFromRequest

java.lang.Object
  extended by org.picocontainer.injectors.ProviderAdapter
      extended by org.picocontainer.web.StringFromRequest
          extended by org.picocontainer.web.IntFromRequest
All Implemented Interfaces:
Serializable, org.picocontainer.ComponentAdapter, org.picocontainer.Injector, org.picocontainer.injectors.Provider, org.picocontainer.LifecycleStrategy

public class IntFromRequest
extends StringFromRequest
implements Serializable

Use this to make a request level component that pulls an integer from a named parameter (GET or POST) of the request. If a parameter of the supplied name is not available for the current request path, then an exception will be thrown. An exception will also be thrown, if the number format is bad.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.picocontainer.web.StringFromRequest
StringFromRequest.ParameterNotFound
 
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter
org.picocontainer.ComponentAdapter.NOTHING
 
Constructor Summary
IntFromRequest(String paramName)
           
 
Method Summary
static void addIntegerRequestParameters(org.picocontainer.MutablePicoContainer toContainer, String... names)
          Add a number of IntFromRequest adapters to a container.
 Class getComponentImplementation()
           
 Object provide(javax.servlet.http.HttpServletRequest req)
           
 
Methods inherited from class org.picocontainer.web.StringFromRequest
addStringRequestParameters, getComponentKey
 
Methods inherited from class org.picocontainer.injectors.ProviderAdapter
accept, decorateComponentInstance, dispose, findAdapterOfType, getComponentInstance, getComponentInstance, getDelegate, getDescriptor, getProvideMethod, hasLifecycle, isLazy, start, stop, useNames, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntFromRequest

public IntFromRequest(String paramName)
Method Detail

getComponentImplementation

public Class getComponentImplementation()
Specified by:
getComponentImplementation in interface org.picocontainer.ComponentAdapter
Overrides:
getComponentImplementation in class StringFromRequest

provide

public Object provide(javax.servlet.http.HttpServletRequest req)
Overrides:
provide in class StringFromRequest

addIntegerRequestParameters

public static void addIntegerRequestParameters(org.picocontainer.MutablePicoContainer toContainer,
                                               String... names)
Add a number of IntFromRequest adapters to a container.

Parameters:
toContainer - the container to add to
names - the list of names to make adapters from


Copyright © 2010. All Rights Reserved.