avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matheus Santana (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1762) Allow putting additional objects into the Velocity template
Date Mon, 30 Nov 2015 13:52:10 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15031790#comment-15031790
] 

Matheus Santana commented on AVRO-1762:
---------------------------------------

Hey there!

I've commited some new code through Github pull request. In summary, that's what I've done:

- Extended desired behavior for other plugin Mojos (Protocol, Schema and IDL);
- Provided test cases;

I did not worry about code replication within the test code because I'm addressing this issue
[elsewhere|https://github.com/apache/avro/pull/60]. I've also noticed that there is common
behavior written within the specific classes which would be a nice fit for the AbstractMojo
class. I'll be glad on helping with such code improvement as soon as we go on here.

I'd really appreciate your feedback about suggested modifications.

> 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)

Mime
View raw message