package com.ether; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import com.ether.annotation.ControllerMethod; public class MethodDescription { MethodDescription( @NotNull final Method method, @NotNull final ControllerMethod annotation ) { _method = method; _view = annotation.view(); _isJsonResult = annotation.jsonResult(); _params = new ArrayList(); } public void addNullParam() { _params.add( null ); } public void addParam( @NotNull final String paramName, @NotNull final Class paramType, final boolean mandatory, final boolean usingJSON ) { _params.add( new ParamDescription( paramName, paramType, mandatory, usingJSON ) ); } @NotNull public String getView() { return _view; } @NotNull public Method getMethod() { return _method; } public Boolean isJsonResult() { return _isJsonResult; } @Nullable public List getParams() { return _params; } public String getName() { return _method.getName(); } @Override public String toString() { return _method.toString(); } @NotNull private Method _method; @NotNull private String _view; private Boolean _isJsonResult; @Nullable private List _params; }