private static void handleDefaultAttributeAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(DefaultAttribute.class)) { DefaultAttribute defaultAttribute = processor.getAnnotation(DefaultAttribute.class); RubyHash defaultAttrs = RubyHash.newHash(rubyRuntime); defaultAttrs.put(defaultAttribute.key(), defaultAttribute.value()); rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("default_attrs"), defaultAttrs }); } }
private static void handleDefaultAttributeAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(DefaultAttribute.class)) { DefaultAttribute defaultAttribute = processor.getAnnotation(DefaultAttribute.class); RubyHash defaultAttrs = RubyHash.newHash(rubyRuntime); defaultAttrs.put(defaultAttribute.key(), defaultAttribute.value()); rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("default_attrs"), defaultAttrs }); } }
private static void handleDefaultAttributesAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(DefaultAttributes.class)) { DefaultAttributes defaultAttributes = processor.getAnnotation(DefaultAttributes.class); RubyHash defaultAttrs = RubyHash.newHash(rubyRuntime); for (DefaultAttribute defaultAttribute : defaultAttributes.value()) { defaultAttrs.put(defaultAttribute.key(), defaultAttribute.value()); } rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("default_attrs"), defaultAttrs }); } }
private static void handleDefaultAttributesAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(DefaultAttributes.class)) { DefaultAttributes defaultAttributes = processor.getAnnotation(DefaultAttributes.class); RubyHash defaultAttrs = RubyHash.newHash(rubyRuntime); for (DefaultAttribute defaultAttribute : defaultAttributes.value()) { defaultAttrs.put(defaultAttribute.key(), defaultAttribute.value()); } rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("default_attrs"), defaultAttrs }); } }