You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/11/27 20:26:11 UTC
[jira] [Commented] (AVRO-1762) Allow putting additional objects
into the Velocity template
[ https://issues.apache.org/jira/browse/AVRO-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15030184#comment-15030184 ]
ASF GitHub Bot commented on AVRO-1762:
--------------------------------------
GitHub user embs opened a pull request:
https://github.com/apache/avro/pull/59
AVRO-1762. Java: Put additional objects into Velocity template
It provides more flexibility when generating code with custom Velocity
templates.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/geteloquent/avro AVRO-1762-velocity-custom-objects
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/avro/pull/59.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #59
----
commit d170bcb764ce539e5e6e475d14e033a6d5eef44f
Author: embs <em...@cin.ufpe.br>
Date: 2015-11-25T18:57:49Z
AVRO-1762. Java: Put additional objects into Velocity template
It provides more flexibility when generating code with custom Velocity
templates.
----
> Allow putting additional objects into the Velocity template
> -----------------------------------------------------------
>
> Key: AVRO-1762
> URL: https://issues.apache.org/jira/browse/AVRO-1762
> Project: Avro
> Issue Type: Improvement
> Components: java
> Reporter: Matheus Santana
> Attachments: AVRO-1762.patch
>
>
> This JIRA proposes the ability to inject custom POJOs into the Velocity template.
> It is possible [to override template directory configuration|https://issues.apache.org/jira/browse/AVRO-963?jql=project%20%3D%20AVRO%20AND%20component%20%3D%20java%20AND%20text%20~%20%22template%22] and thus make the compiler to generate customized code. However, customization possibilities are constrained to [Velocity Template Language|https://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html#velocity_template_language_vtl:_an_introduction] and [objects injected|https://github.com/apache/avro/blob/trunk/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java#L339-L340] into the template's context.
> The ability of injecting custom objects into the template's context would leverage customization possibilities to the whole Java language itself. The patch I'm about to attach modifies both compiler and maven-plugin in order to provide client applications with the ability of easy injecting custom Java objects into the Velocity templates' context.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)