org.vraptor.component
Class DefaultLogicMethod

java.lang.Object
  extended by org.vraptor.component.DefaultLogicMethod
All Implemented Interfaces:
LogicMethod

public class DefaultLogicMethod
extends Object
implements LogicMethod

Represents a logic method.

Author:
Guilherme Silveira

Constructor Summary
DefaultLogicMethod(ValidationErrorsFactory factory, String name, Method method, Method validateMethod, List<MethodParameter> parameters)
          Constructs it based on the logics name and method
 
Method Summary
 String execute(Object component, LogicRequest context, Object[] params)
          Executes the logic by invoking the method
 ComponentType getComponentType()
           
 Method getMetadata()
           
 String getName()
          Returns the logic's name
 List<MethodParameter> getParameters()
           
 void setComponentType(ComponentType componentType)
           
 boolean shouldRedirect()
          Should execute a redirect after business logic execution.
 ValidationErrors validate(Object component, LogicRequest context, ResourceBundle bundle, Object[] params)
          Validates this logic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLogicMethod

public DefaultLogicMethod(ValidationErrorsFactory factory,
                          String name,
                          Method method,
                          Method validateMethod,
                          List<MethodParameter> parameters)
Constructs it based on the logics name and method

Method Detail

getName

public String getName()
Description copied from interface: LogicMethod
Returns the logic's name

Specified by:
getName in interface LogicMethod
Returns:
its name

execute

public String execute(Object component,
                      LogicRequest context,
                      Object[] params)
               throws LogicException
Description copied from interface: LogicMethod
Executes the logic by invoking the method

Specified by:
execute in interface LogicMethod
Parameters:
component - the component to invoke the method on
Returns:
the method's result
Throws:
LogicException - something wrong happenned

validate

public ValidationErrors validate(Object component,
                                 LogicRequest context,
                                 ResourceBundle bundle,
                                 Object[] params)
                          throws UnstableValidationException
Description copied from interface: LogicMethod
Validates this logic.

Specified by:
validate in interface LogicMethod
params - method parameters
Returns:
the errors
Throws:
UnstableValidationException

shouldRedirect

public boolean shouldRedirect()
Description copied from interface: LogicMethod
Should execute a redirect after business logic execution.

Specified by:
shouldRedirect in interface LogicMethod
Returns:
true if redirection should be done

getMetadata

public Method getMetadata()
Specified by:
getMetadata in interface LogicMethod

getParameters

public List<MethodParameter> getParameters()
Specified by:
getParameters in interface LogicMethod

getComponentType

public ComponentType getComponentType()
Specified by:
getComponentType in interface LogicMethod

setComponentType

public void setComponentType(ComponentType componentType)


Copyright © 2004-2008 VRaptor. All Rights Reserved.