Class: FactoryBuilderBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/jrubyfx-fxmlloader.rb

Overview

builder to build factories

Class Method Summary collapse

Class Method Details

.new(type, factory) ⇒ Object



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/jrubyfx-fxmlloader.rb', line 233

def self.new(type, factory)
  type = type.java_class
  factoryMethod = nil
  begin
    factoryMethod = MethodUtil.getMethod(type, factory, []);
  rescue NoSuchMethodException => exception
    raise LoadException.new(exception);
  end

  begin
    return MethodUtil.invoke(factoryMethod, nil, []);
  rescue IllegalAccessException => exception
    raise LoadException.new(exception);
  rescue InvocationTargetException => exception
    raise LoadException.new(exception);
  end
end