Module: Rjb::JMethod

Included in:
Rjb_JavaClass, Rjb_JavaProxy
Defined in:
lib/rjb.rb

Instance Method Summary collapse

Instance Method Details

#format_sigs(s) ⇒ Object



89
90
91
92
93
94
95
96
97
# File 'lib/rjb.rb', line 89

def format_sigs(s)
  if s.size < 0
    ''
  elsif s.size == 1
    s[0]
  else
    "[#{s.map{|m|m.nil? ? 'void' : m}.join(', ')}]"
  end
end

#instance_method?(m) ⇒ Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/rjb.rb', line 76

def instance_method?(m)
  m.modifiers & MODIFIER.STATIC == 0
end

#jmethods(org, klass, &blk) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/rjb.rb', line 82

def jmethods(org, klass, &blk)
  (org + klass.getMethods.select do |m|
     blk.call(m)
  end.map do |m|
    m.name
  end).uniq
end

#public_method?(m) ⇒ Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/rjb.rb', line 79

def public_method?(m)
  (m.modifiers & MODIFIER.PUBLIC) == MODIFIER.PUBLIC
end