Module: Rjb::JMethod

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) format_sigs(s)



47
48
49
50
51
52
53
54
55
# File 'lib/rjb.rb', line 47

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

- (Boolean) instance_method?(m)

Returns:

  • (Boolean)


34
35
36
# File 'lib/rjb.rb', line 34

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

- (Object) jmethods(org, klass, &blk)



40
41
42
43
44
45
46
# File 'lib/rjb.rb', line 40

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

- (Boolean) public_method?(m)

Returns:

  • (Boolean)


37
38
39
# File 'lib/rjb.rb', line 37

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