polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niclas Hedhman (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (POLYGENE-306) Possibility to add annotations on methods at bootstrap
Date Thu, 26 Apr 2018 08:52:00 GMT

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

Niclas Hedhman edited comment on POLYGENE-306 at 4/26/18 8:51 AM:
------------------------------------------------------------------

Second question is how to make that reasonable in bootstrap time?

Say we want to add @TestAnnotation and @AnotherAnnotation to the put() method in HashMap;
{code:java}
module.services( Map.class ).withMixins( HashMap.class );
module.forMixin( HashMap.class )
      .annotations( annotation( TestAnnotation.class,
                                p( "intValue", 5 ),
                                p( "stringValue", "Niclas" ) ),
                    annotation( AnotherAnnotation.class ) )
      .put( null, null );{code}
That looks kind of neat, and is probably possible to implement as well.


was (Author: niclas):
Second question is how to make that reasonable in bootstrap time?

Say we want to add @TestAnnotation and @AnotherAnnotation to the put() method in HashMap;
{code:java}
module.services( Map.class ).withMixins( HashMap.class );
module.forMixin( HashMap.class )
      .annotations( annotation( TestAnnotation.class,
                                p( "intValue", 5 ),
                                p( "stringValue", "Niclas" ) ),
                    annotation( AnotherAnnotation.class ) )
      .put( null, null );
{code}

> Possibility to add annotations on methods at bootstrap
> ------------------------------------------------------
>
>                 Key: POLYGENE-306
>                 URL: https://issues.apache.org/jira/browse/POLYGENE-306
>             Project: Polygene
>          Issue Type: New Feature
>            Reporter: Niclas Hedhman
>            Priority: Major
>
> Currently we can manipulate types pretty much freely at bootstrap, but we can't add annotations
to methods, which would be useful for instance when working with external types not under
one's control.
> This will need to add metaInfo to Property and add the annotation there, rather than
trying to compile it into the method itself.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message