
vertx-groovy.template.classbody.templ Maven / Gradle / Ivy
private final def @{type.raw} delegate;\n
public @{constructor}(Object delegate) {\n
@if{concrete && concreteSuperType != null}
super((@{type.raw}) delegate);\n
@end{}
this.delegate = (@{type.raw}) delegate;\n
}\n
public Object getDelegate() {\n
return delegate;\n
}\n
@foreach{method:methods}
@if{method.doc != null}
/**\n
@{renderDocToHtml(" *", method.doc, renderLinkToHtml)}
@foreach{param: method.params}
* @param @{param.name} @if{param.description != null}@{renderTokensToHtml("", param.description.tokens, renderLinkToHtml, "")}@end{}@if{param.type.kind == CLASS_DATA_OBJECT} (see @{renderDataObjectHtmlLink(param.type)})@end{}\n
@end{}
@if{!method.returnType.name.equals("void")}
* @return @if{method.returnDescription != null}@{renderTokensToHtml("", method.returnDescription.tokens, renderLinkToHtml, "")}@end{}@if{method.returnType.kind == CLASS_DATA_OBJECT} (see @{renderDataObjectHtmlLink(method.returnType)})@end{}\n
@end{}
*/\n
@end{}
public @if{method.staticMethod}static @end{}@if{method.typeParams.size() > 0}<@foreach{typeParam:method.typeParams}@{typeParam.name}@end{', '}> @end{}@{genConvReturn(method.returnType)} @{method.name}(@foreach{param: method.params}@includeNamed{'paramTemplate';param=param;defaultDataObject=defaultDataObjectMap[method]}@end{', '}) {\n
@if{method.fluent}
@includeNamed{'invokeDelegate';method=method};\n
@if{method.returnType.variable}
return (@{method.returnType.name}) this;\n
@else{}
return this;\n
@end{}
@else{method.returnType.name.equals('void')}
@includeNamed{'invokeDelegate';method=method};\n
@else{}
@if{method.cacheReturn}
if (cached_@{cacheDecls.size()} != null) {\n
return cached_@{cacheDecls.size()};\n
}\n
@end{}
@if{method.returnType.kind == CLASS_OBJECT}
// This cast is cleary flawed\n
def ret = (@{method.returnType.simpleName}) InternalHelper.wrapObject(@includeNamed{'invokeDelegate';method=method});\n
@else{method.returnType.kind == CLASS_JSON_OBJECT}
def ret = (Map)InternalHelper.wrapObject(@includeNamed{'invokeDelegate';method=method});\n
@else{method.returnType.kind == CLASS_DATA_OBJECT}
def ret = (Map)InternalHelper.wrapObject(@includeNamed{'invokeDelegate';method=method}?.toJson());\n
@else{method.returnType.kind == CLASS_JSON_ARRAY}
def ret = (List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy