@@ -26,32 +26,32 @@ class ClientMethodWriter {
2626 ClientMethodWriter (MethodReader method , Append writer , ProcessingContext ctx ) {
2727 this .method = method ;
2828 this .writer = writer ;
29- this .webMethod = method .getWebMethod ();
29+ this .webMethod = method .webMethod ();
3030 this .ctx = ctx ;
31- this .returnType = Util .parseType (method .getReturnType ());
31+ this .returnType = Util .parseType (method .returnType ());
3232 }
3333
3434 void addImportTypes (ControllerReader reader ) {
3535 reader .addImportTypes (returnType .importTypes ());
36- for (MethodParam param : method .getParams ()) {
36+ for (MethodParam param : method .params ()) {
3737 param .addImports (reader );
3838 }
3939 }
4040
4141 private void methodStart (Append writer ) {
42- for (MethodParam param : method .getParams ()) {
42+ for (MethodParam param : method .params ()) {
4343 checkBodyHandler (param );
4444 }
45- writer .append (" // %s %s" , webMethod , method .getWebMethodPath ()).eol ();
45+ writer .append (" // %s %s" , webMethod , method .webMethodPath ()).eol ();
4646 writer .append (" @Override" ).eol ();
4747 writer .append (" public %s%s %s(" , methodGenericParams , returnType .shortType (), method .simpleName ());
4848 int count = 0 ;
49- for (MethodParam param : method .getParams ()) {
49+ for (MethodParam param : method .params ()) {
5050 if (count ++ > 0 ) {
5151 writer .append (", " );
5252 }
53- writer .append (param .getUType ().shortType ()).append (" " );
54- writer .append (param .getName ());
53+ writer .append (param .utype ().shortType ()).append (" " );
54+ writer .append (param .name ());
5555 }
5656 writer .append (") {" ).eol ();
5757 }
@@ -60,10 +60,10 @@ private void methodStart(Append writer) {
6060 * Assign a method parameter as *the* BodyHandler.
6161 */
6262 private void checkBodyHandler (MethodParam param ) {
63- if (param .getRawType ().startsWith (BODY_HANDLER )) {
63+ if (param .rawType ().startsWith (BODY_HANDLER )) {
6464 param .setResponseHandler ();
6565 bodyHandlerParam = param ;
66- methodGenericParams = param .getUType ().genericParams ();
66+ methodGenericParams = param .utype ().genericParams ();
6767 }
6868 }
6969
@@ -75,8 +75,8 @@ void write() {
7575 }
7676 writer .append ("clientContext.request()" ).eol ();
7777
78- PathSegments pathSegments = method .getPathSegments ();
79- Set <PathSegments .Segment > segments = pathSegments .getSegments ();
78+ PathSegments pathSegments = method .pathSegments ();
79+ Set <PathSegments .Segment > segments = pathSegments .segments ();
8080
8181 writeHeaders ();
8282 writePaths (segments );
@@ -88,7 +88,7 @@ void write() {
8888 }
8989
9090 private void writeEnd () {
91- WebMethod webMethod = method .getWebMethod ();
91+ WebMethod webMethod = method .webMethod ();
9292 writer .append (" .%s()" , webMethod .name ()).eol ();
9393 if (returnType == UType .VOID ) {
9494 writer .append (" .asVoid();" ).eol ();
@@ -144,57 +144,57 @@ private void writeResponse(String type0, String type1) {
144144
145145 private void writeWithHandler () {
146146 if (bodyHandlerParam != null ) {
147- writer .append (".handler(%s);" , bodyHandlerParam .getName ()).eol ();
147+ writer .append (".handler(%s);" , bodyHandlerParam .name ()).eol ();
148148 } else {
149149 writer .append (".handler(responseHandler);" ).eol (); // Better to barf here?
150150 }
151151 }
152152
153153 private void writeQueryParams (PathSegments pathSegments ) {
154- for (MethodParam param : method .getParams ()) {
155- ParamType paramType = param .getParamType ();
154+ for (MethodParam param : method .params ()) {
155+ ParamType paramType = param .paramType ();
156156 if (paramType == ParamType .QUERYPARAM ) {
157- if (pathSegments .segment (param .getParamName ()) == null ) {
157+ if (pathSegments .segment (param .paramName ()) == null ) {
158158 if (isMap (param )) {
159- writer .append (" .queryParam(%s)" , param .getName ()).eol ();
159+ writer .append (" .queryParam(%s)" , param .name ()).eol ();
160160 } else {
161- writer .append (" .queryParam(\" %s\" , %s)" , param .getParamName (), param .getName ()).eol ();
161+ writer .append (" .queryParam(\" %s\" , %s)" , param .paramName (), param .name ()).eol ();
162162 }
163163 }
164164 }
165165 }
166166 }
167167
168168 private void writeHeaders () {
169- for (MethodParam param : method .getParams ()) {
170- ParamType paramType = param .getParamType ();
169+ for (MethodParam param : method .params ()) {
170+ ParamType paramType = param .paramType ();
171171 if (paramType == ParamType .HEADER ) {
172172 if (isMap (param )) {
173- writer .append (" .header(%s)" , param .getName ()).eol ();
173+ writer .append (" .header(%s)" , param .name ()).eol ();
174174 } else {
175- writer .append (" .header(\" %s\" , %s)" , param .getParamName (), param .getName ()).eol ();
175+ writer .append (" .header(\" %s\" , %s)" , param .paramName (), param .name ()).eol ();
176176 }
177177 }
178178 }
179179 }
180180
181181 private void writeBeanParams (PathSegments segments ) {
182- for (MethodParam param : method .getParams ()) {
183- final String varName = param .getName ();
184- ParamType paramType = param .getParamType ();
182+ for (MethodParam param : method .params ()) {
183+ final String varName = param .name ();
184+ ParamType paramType = param .paramType ();
185185 PathSegments .Segment segment = segments .segment (varName );
186186 if (segment == null && paramType == ParamType .BEANPARAM ) {
187- TypeElement formBeanType = ctx .getTypeElement (param .getRawType ());
188- BeanParamReader form = new BeanParamReader (ctx , formBeanType , param .getName (), param .getShortType (), ParamType .QUERYPARAM );
187+ TypeElement formBeanType = ctx .typeElement (param .rawType ());
188+ BeanParamReader form = new BeanParamReader (ctx , formBeanType , param .name (), param .shortType (), ParamType .QUERYPARAM );
189189 form .writeFormParams (writer );
190190 }
191191 }
192192 }
193193
194194 private void writeFormParams (PathSegments segments ) {
195- for (MethodParam param : method .getParams ()) {
196- final String varName = param .getName ();
197- ParamType paramType = param .getParamType ();
195+ for (MethodParam param : method .params ()) {
196+ final String varName = param .name ();
197+ ParamType paramType = param .paramType ();
198198 PathSegments .Segment segment = segments .segment (varName );
199199 if (segment == null ) {
200200 // not a path or matrix parameter
@@ -206,22 +206,22 @@ private void writeFormParams(PathSegments segments) {
206206 private void writeFormParam (MethodParam param , ParamType paramType ) {
207207 if (paramType == ParamType .FORMPARAM ) {
208208 if (isMap (param )) {
209- writer .append (" .formParam(%s)" , param .getName ()).eol ();
209+ writer .append (" .formParam(%s)" , param .name ()).eol ();
210210 } else {
211- writer .append (" .formParam(\" %s\" , %s)" , param .getParamName (), param .getName ()).eol ();
211+ writer .append (" .formParam(\" %s\" , %s)" , param .paramName (), param .name ()).eol ();
212212 }
213213 } else if (paramType == ParamType .FORM ) {
214- TypeElement formBeanType = ctx .getTypeElement (param .getRawType ());
215- BeanParamReader form = new BeanParamReader (ctx , formBeanType , param .getName (), param .getShortType (), ParamType .FORMPARAM );
214+ TypeElement formBeanType = ctx .typeElement (param .rawType ());
215+ BeanParamReader form = new BeanParamReader (ctx , formBeanType , param .name (), param .shortType (), ParamType .FORMPARAM );
216216 form .writeFormParams (writer );
217217 }
218218 }
219219
220220 private void writeBody () {
221- for (MethodParam param : method .getParams ()) {
222- ParamType paramType = param .getParamType ();
221+ for (MethodParam param : method .params ()) {
222+ ParamType paramType = param .paramType ();
223223 if (paramType == ParamType .BODY ) {
224- writer .append (" .body(%s)" , param .getName ()).eol ();
224+ writer .append (" .body(%s)" , param .name ()).eol ();
225225 }
226226 }
227227 }
@@ -244,7 +244,7 @@ private void writePaths(Set<PathSegments.Segment> segments) {
244244 }
245245
246246 private boolean isMap (MethodParam param ) {
247- return isMap (param .getUType ().mainType ());
247+ return isMap (param .utype ().mainType ());
248248 }
249249
250250 private boolean isMap (String type0 ) {
0 commit comments