[
https://issues.apache.org/jira/browse/THRIFT-219?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Fredrik Hedberg updated THRIFT-219:
-----------------------------------
Description:
Since Java lack the equivalent of C#'s fancy 'partial' class modifier,
extending the logic of a Thrift-generated class means you have to do it quite
literally. This patch allows the developer to write code templates that are
injected into the generated classes by the compiler, allowing him to extend the
generated classes in any way he wants.
The code templates are presumed to be found in something like
/tmpl-java/com/example/Document.tmpl, and are injected into structs and
services (.Iface and .Client).
was:
Since Java lack the equivalent of C#'s fancy 'partial' class modifier,
extending the logic of a Thrift-generated class means you have to do it quite
literally. This patch allows the developer to write code templates that are
injected into the generated classes by the compiler, allowing him to extend the
generated classes in any way he wants.
The code templates are presumed to be found in
/tmpl-java/$packagename/$typename.tmpl, and are injected into structs and
services (.Iface and .Client).
> Inject user-created templates into generated code
> -------------------------------------------------
>
> Key: THRIFT-219
> URL: https://issues.apache.org/jira/browse/THRIFT-219
> Project: Thrift
> Issue Type: New Feature
> Components: Compiler (Java)
> Reporter: Fredrik Hedberg
> Priority: Minor
> Attachments: thrift-templates-1.diff
>
>
> Since Java lack the equivalent of C#'s fancy 'partial' class modifier,
> extending the logic of a Thrift-generated class means you have to do it quite
> literally. This patch allows the developer to write code templates that are
> injected into the generated classes by the compiler, allowing him to extend
> the generated classes in any way he wants.
> The code templates are presumed to be found in something like
> /tmpl-java/com/example/Document.tmpl, and are injected into structs and
> services (.Iface and .Client).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.