org.objectweb.jac.aspects.gui
Class InputWrapper

java.lang.Object
  extended byorg.objectweb.jac.core.Wrapper
      extended byorg.objectweb.jac.aspects.gui.InputWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable

public class InputWrapper
extends Wrapper

This wrapper asks the user the parameters of the invoked method if the attribute Gui.askForParameters is defined in the current collaboration.

See Also:
Display.showInput(Object,AbstractMethodItem,Object[]), InputSequence, Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
InputWrapper(AspectComponent ac)
           
 
Method Summary
 Object askForParameters(Interaction interaction)
          Calls the Display.showInput method on the current display.
protected  boolean askingSequence(Display display, DisplayContext context, AbstractMethodItem method, Interaction interaction, Class[] paramTypes)
           
protected  boolean autoCreate(Display display, DisplayContext context, AbstractMethodItem method, Interaction interaction, Class[] paramTypes)
           
 void catchInputCanceled(InputCanceledException e)
           
 Object construct(ConstructorInvocation invocation)
           
 Object create(ClassItem classItem, Display display)
          This method performs all the inputs operations for an instance creation.
 Object invoke(MethodInvocation invocation)
           
static Object newInstance(Class cl, Display display)
          Create a new instance of a class.
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputWrapper

public InputWrapper(AspectComponent ac)
Method Detail

askForParameters

public Object askForParameters(Interaction interaction)
                        throws org.objectweb.jac.aspects.gui.InputFailedException,
                               InputCanceledException
Calls the Display.showInput method on the current display.

Returns:
the value returned by the wrapped method
Throws:
org.objectweb.jac.aspects.gui.InputFailedException
InputCanceledException
See Also:
Display.showInput(Object,AbstractMethodItem,Object[])

autoCreate

protected boolean autoCreate(Display display,
                             DisplayContext context,
                             AbstractMethodItem method,
                             Interaction interaction,
                             Class[] paramTypes)

askingSequence

protected boolean askingSequence(Display display,
                                 DisplayContext context,
                                 AbstractMethodItem method,
                                 Interaction interaction,
                                 Class[] paramTypes)
                          throws org.objectweb.jac.aspects.gui.InputFailedException,
                                 InputCanceledException
Throws:
org.objectweb.jac.aspects.gui.InputFailedException
InputCanceledException

create

public Object create(ClassItem classItem,
                     Display display)
              throws org.objectweb.jac.aspects.gui.InputFailedException,
                     InputCanceledException
This method performs all the inputs operations for an instance creation.

Parameters:
classItem - the class to instantiate
display - the display to use
Throws:
org.objectweb.jac.aspects.gui.InputFailedException
InputCanceledException

newInstance

public static Object newInstance(Class cl,
                                 Display display)
                          throws InstantiationException,
                                 IllegalAccessException
Create a new instance of a class. If the class has known subclasses, the user will be given the choice of the actual class to instantiate.

Parameters:
cl - the class to instantiate
display - display to use for user interaction
Returns:
a new instance of the class
Throws:
InstantiationException
IllegalAccessException

catchInputCanceled

public void catchInputCanceled(InputCanceledException e)

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Overrides:
invoke in class Wrapper
Throws:
Throwable

construct

public Object construct(ConstructorInvocation invocation)
                 throws Throwable
Specified by:
construct in interface ConstructorInterceptor
Overrides:
construct in class Wrapper
Throws:
Throwable