Module: Antwrap::JavaAdapter

Defined in:
lib/java_adapter.rb

Class Method Summary collapse

Class Method Details

.import_class(name) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/java_adapter.rb', line 21

def import_class(name)
  if is_jruby_interpreter?
    return import_using_jruby(name)
  else
    return Rjb::import(name)
  end
end

.is_jruby_interpreter?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/java_adapter.rb', line 17

def is_jruby_interpreter?
  return RUBY_PLATFORM =~ /java/
end

.load(files = [], args = []) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/java_adapter.rb', line 29

def load(files=[], args=[])
  if is_jruby_interpreter?
    files.each {|jar| require jar }
  else
    Rjb::load(files.join(File::PATH_SEPARATOR), [])
  end
end