private static void handleFormatAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(Format.class)) { Format format = processor.getAnnotation(Format.class); switch (format.value()) { case CUSTOM: rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("regexp"), convertRegexp(rubyRuntime, format.regexp()) }); default: rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("format"), rubyRuntime.newSymbol(format.value().optionValue().substring(1)) }); } } }
private static void handleFormatAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(Format.class)) { Format format = processor.getAnnotation(Format.class); switch (format.value()) { case CUSTOM: rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("regexp"), convertRegexp(rubyRuntime, format.regexp()) }); default: rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("format"), rubyRuntime.newSymbol(format.value().optionValue().substring(1)) }); } } }