org.vraptor.component
Class MethodParameter

java.lang.Object
  extended by org.vraptor.component.MethodParameter
All Implemented Interfaces:
ReadParameter

public class MethodParameter
extends Object
implements ReadParameter

Defines an argument that a logic method receives.

Since:
2.3
Author:
Guilherme Silveira

Constructor Summary
MethodParameter(Class<?> param, Type generic, int position, String key)
           
 
Method Summary
 Type getGenericType()
           
 String getKey()
          The parameter key
 Class<? extends Converter> getOverridenConverter()
          Returns the overriden converter class attached to this read parameter
 int getPosition()
           
 Class<?> getType()
           
 Object guaranteeExistence(Object component, Object[] methodParams)
          Guarantees it's existence by instantiating itself if needed (or oblied), connecting to the logic component and returning itself
 boolean mightCreate()
          Should it instantiate required fields on the fly?
 Object newInstance()
           
 void set(Object component, Object[] methodParams, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodParameter

public MethodParameter(Class<?> param,
                       Type generic,
                       int position,
                       String key)
Method Detail

getKey

public String getKey()
Description copied from interface: ReadParameter
The parameter key

Specified by:
getKey in interface ReadParameter
Returns:
key

getOverridenConverter

public Class<? extends Converter> getOverridenConverter()
Description copied from interface: ReadParameter
Returns the overriden converter class attached to this read parameter

Specified by:
getOverridenConverter in interface ReadParameter
Returns:
the converter class

guaranteeExistence

public Object guaranteeExistence(Object component,
                                 Object[] methodParams)
                          throws SettingException
Description copied from interface: ReadParameter
Guarantees it's existence by instantiating itself if needed (or oblied), connecting to the logic component and returning itself

Specified by:
guaranteeExistence in interface ReadParameter
Parameters:
component - the logic component
Returns:
the instantiated object itself
Throws:
SettingException - some problem during its creation

mightCreate

public boolean mightCreate()
Description copied from interface: ReadParameter
Should it instantiate required fields on the fly?

Specified by:
mightCreate in interface ReadParameter
Returns:
true if it should instantiate them

getType

public Class<?> getType()
Specified by:
getType in interface ReadParameter

set

public void set(Object component,
                Object[] methodParams,
                Object value)
         throws SettingException
Specified by:
set in interface ReadParameter
Throws:
SettingException

getGenericType

public Type getGenericType()
Specified by:
getGenericType in interface ReadParameter

newInstance

public Object newInstance()
                   throws ComponentInstantiationException
Throws:
ComponentInstantiationException

getPosition

public int getPosition()


Copyright © 2004-2008 VRaptor. All Rights Reserved.