source: ether_2012/common/implementation/com/ether/MethodDescription.java @ 319

Last change on this file since 319 was 319, checked in by vmipsl, 12 years ago

Import du projet Ether pour le nouveau look 2012

File size: 1.5 KB
Line 
1package com.ether;
2
3import java.lang.reflect.Method;
4import java.util.ArrayList;
5import java.util.List;
6
7import org.jetbrains.annotations.NotNull;
8import org.jetbrains.annotations.Nullable;
9
10import com.ether.annotation.ControllerMethod;
11
12public class MethodDescription
13{
14    MethodDescription( @NotNull final Method method, @NotNull final ControllerMethod annotation )
15    {
16        _method = method;
17        _view = annotation.view();
18        _isJsonResult = annotation.jsonResult();
19        _params = new ArrayList<ParamDescription>();
20    }
21
22    public void addNullParam()
23    {
24        _params.add( null );
25    }
26
27    public void addParam( @NotNull final String paramName, @NotNull final Class<?> paramType, final boolean mandatory, final boolean usingJSON )
28    {
29        _params.add( new ParamDescription( paramName, paramType, mandatory, usingJSON ) );
30    }
31
32    @NotNull
33    public String getView()
34    {
35        return _view;
36    }
37
38    @NotNull
39    public Method getMethod()
40    {
41        return _method;
42    }
43
44    public Boolean isJsonResult()
45    {
46        return _isJsonResult;
47    }
48
49    @Nullable
50    public List<ParamDescription> getParams()
51    {
52        return _params;
53    }
54
55    public String getName()
56    {
57        return _method.getName();
58    }
59
60    @Override
61    public String toString()
62    {
63        return _method.toString();
64    }
65
66    @NotNull
67    private Method _method;
68    @NotNull
69    private String _view;
70    private Boolean _isJsonResult;
71    @Nullable
72    private List<ParamDescription> _params;
73}
Note: See TracBrowser for help on using the repository browser.