Issue Type: Bug Bug
Assignee: Thomas E Enebo
Created: 21/Oct/12 1:10 PM
Description:

This could be PEBKAC, but I can't seem to get this to work.

class AnnotationTest
  def self.inject_attr_accessor(method_name, type)
    module_eval <<-RUBY
      java_annotation 'Inject'
      java_signature "void set_#{method_name}(#{type} x)"
      def #{method_name}=(x)
        @#{method_name} = x
      end

      attr_reader method_name
    RUBY
  end

  inject_attr_accessor :name, 'String'
end

Desired behaviour: Compiling {monospace}jrubyc --java{monospace} produces a java class with an annotated {monospace}set_name{monospace} method.

As long as there at least one way to do this (with any of the eval methods, or some other way), I don't particularly care which it is.

For bonus points, let me put a signature on {monospace}attr_writer{monospace}

Project: JRuby
Priority: Major Major
Reporter: Xavier Shay
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to