本文整理了Java中org.jruby.RubyModule.callMethod
方法的一些代码示例,展示了RubyModule.callMethod
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.callMethod
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:callMethod
暂无
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public void unregister() {
asciidoctorModule
.callMethod("unregister_extension", rubyRuntime.newString(this.groupName));
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public RubyExtensionRegistryImpl includeProcessor(String includeProcessor) {
getAsciidoctorModule().callMethod( "include_processor", rubyRuntime.newString(includeProcessor));
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry docinfoProcessor(Class<? extends DocinfoProcessor> docInfoProcessor) {
RubyClass rubyClass = DocinfoProcessorProxy.register(rubyRuntime, docInfoProcessor);
getAsciidoctorModule().callMethod("docinfo_processor", rubyClass);
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry preprocessor(Preprocessor preprocessor) {
RubyClass rubyClass = PreprocessorProxy.register(rubyRuntime, preprocessor);
getAsciidoctorModule().callMethod("preprocessor", rubyClass);
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry blockMacro(BlockMacroProcessor blockMacroProcessor) {
RubyClass rubyClass = BlockMacroProcessorProxy.register(rubyRuntime, blockMacroProcessor);
getAsciidoctorModule().callMethod("block_macro", rubyClass);
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public RubyExtensionRegistryImpl docinfoProcessor(String docinfoProcessor) {
getAsciidoctorModule().callMethod( "docinfo_processor", rubyRuntime.newString(docinfoProcessor));
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public RubyExtensionRegistryImpl inlineMacro(String inlineMacroProcessor) {
getAsciidoctorModule().callMethod( "inline_macro", rubyRuntime.newString(inlineMacroProcessor));
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry postprocessor(Postprocessor postprocessor) {
RubyClass rubyClass = PostprocessorProxy.register(asciidoctor, postprocessor);
getAsciidoctorModule().callMethod("postprocessor", rubyClass);
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry includeProcessor(IncludeProcessor includeProcessor) {
RubyClass rubyClass = IncludeProcessorProxy.register(asciidoctor, includeProcessor);
getAsciidoctorModule().callMethod("include_processor", rubyClass);
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry blockMacro(BlockMacroProcessor blockMacroProcessor) {
RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
getAsciidoctorModule().callMethod("block_macro", rubyClass);
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry blockMacro(String macroName, BlockMacroProcessor blockMacroProcessor) {
RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
getAsciidoctorModule().callMethod("block_macro", rubyClass, rubyRuntime.newString(macroName));
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public RubyExtensionRegistryImpl inlineMacro(String blockName, String inlineMacroProcessor) {
getAsciidoctorModule().callMethod( "inline_macro", rubyRuntime.newString(inlineMacroProcessor), RubyUtils.toSymbol(rubyRuntime, blockName));
return this;
}
代码示例来源:origin: org.jruby/jruby-complete
public final IRubyObject getConstant(ThreadContext context, StaticScope scope, String name, int index) {
IRubyObject value = getValue(context, scope, name, index);
// We can callsite cache const_missing if we want
return value != null ? value : scope.getModule().callMethod(context, "const_missing", context.runtime.fastNewSymbol(name));
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry blockMacro(String macroName, BlockMacroProcessor blockMacroProcessor) {
RubyClass rubyClass = BlockMacroProcessorProxy.register(rubyRuntime, blockMacroProcessor);
getAsciidoctorModule().callMethod("block_macro", rubyClass, rubyRuntime.newString(macroName));
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry blockMacro(String blockName,
Class<? extends BlockMacroProcessor> blockMacroProcessor) {
RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
getAsciidoctorModule().callMethod("block_macro", rubyClass, rubyRuntime.newString(blockName));
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry inlineMacro(String macroName,
Class<? extends InlineMacroProcessor> inlineMacroProcessor) {
RubyClass rubyClass = InlineMacroProcessorProxy.register(asciidoctor, inlineMacroProcessor);
getAsciidoctorModule().callMethod("inline_macro", rubyClass, rubyRuntime.newString(macroName));
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@SuppressWarnings("unchecked")
@Override
public DocumentHeader readDocumentHeader(File filename) {
RubyHash rubyHash = getParseHeaderOnlyOption();
Document document = (Document) NodeConverter.createASTNode(getAsciidoctorModule().callMethod("load_file", rubyRuntime.newString(filename.getAbsolutePath()), rubyHash));
return toDocumentHeader(document);
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public JavaExtensionRegistry inlineMacro(Class<? extends InlineMacroProcessor> inlineMacroProcessor) {
String name = getName(inlineMacroProcessor);
RubyClass rubyClass = InlineMacroProcessorProxy.register(asciidoctor, inlineMacroProcessor);
getAsciidoctorModule().callMethod("inline_macro", rubyClass, rubyRuntime.newString(name));
return this;
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public void register() {
IRubyObject callback = extensionGroupClass.newInstance(rubyRuntime.getCurrentContext(), Block.NULL_BLOCK);
asciidoctorModule.callMethod("register_extension_group",
rubyRuntime.newString(this.groupName),
callback,
JavaEmbedUtils.javaToRuby(rubyRuntime, registrators));
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "alias_method", required = 2)
public RubyModule alias_method(ThreadContext context, IRubyObject newId, IRubyObject oldId) {
RubySymbol newSym = TypeConverter.checkID(newId);
RubySymbol oldSym = TypeConverter.checkID(oldId); // MRI uses rb_to_id but we return existing symbol
defineAlias(newSym.idString(), oldSym.idString());
if (isSingleton()) {
((MetaClass) this).getAttached().callMethod(context, "singleton_method_added", newSym);
} else {
callMethod(context, "method_added", newSym);
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!