org.objectweb.jac.aspects.gui
Class InputWrapper
java.lang.Object
|
+--org.objectweb.jac.core.Wrapper
|
+--org.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
Fields inherited from class org.objectweb.jac.core.Wrapper |
ac, cr |
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. |
InputWrapper
public InputWrapper(AspectComponent ac)
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
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
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 instantiatedisplay
- the display to use
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 instantiatedisplay
- display to use for user interaction
- Returns:
- a new instance of the class
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
Throwable
construct
public Object construct(ConstructorInvocation invocation)
throws Throwable
- Specified by:
construct
in interface ConstructorInterceptor
- Overrides:
construct
in class Wrapper
Throwable