module Antwrap::JavaAdapter
Public Class Methods
import_class(name)
click to toggle source
# 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?()
click to toggle source
# File lib/java_adapter.rb, line 17 def is_jruby_interpreter? return RUBY_PLATFORM =~ /java/ end
load(files=[], args=[])
click to toggle source
# 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
Private Class Methods
import_using_jruby(name)
click to toggle source
# File lib/java_adapter.rb, line 47 def JavaAdapter.import_using_jruby(name) java_import(name) return remove_const(name.scan(/[_a-zA-Z0-9$]+/).last) end
Private Instance Methods
import_class(name)
click to toggle source
# 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?()
click to toggle source
# File lib/java_adapter.rb, line 17 def is_jruby_interpreter? return RUBY_PLATFORM =~ /java/ end
load(files=[], args=[])
click to toggle source
# 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