use of nokogiri.internals.ReaderNode.ElementNode in project gocd by gocd.
the class XmlReader method empty_element_p.
@JRubyMethod(name = { "empty_element?", "self_closing?" })
public IRubyObject empty_element_p(ThreadContext context) {
ReaderNode readerNode = currentNode();
ensureNodeClosed(context);
if (readerNode == null)
return context.getRuntime().getNil();
if (!(readerNode instanceof ElementNode))
context.getRuntime().getFalse();
return RubyBoolean.newBoolean(context.getRuntime(), !readerNode.hasChildren);
}
use of nokogiri.internals.ReaderNode.ElementNode in project nokogiri by sparklemotion.
the class XmlReader method empty_element_p.
@JRubyMethod(name = { "empty_element?", "self_closing?" })
public IRubyObject empty_element_p(ThreadContext context) {
ReaderNode readerNode = currentNode();
ensureNodeClosed(context);
if (readerNode == null) {
return context.getRuntime().getNil();
}
if (!(readerNode instanceof ElementNode)) {
context.getRuntime().getFalse();
}
return RubyBoolean.newBoolean(context.getRuntime(), !readerNode.hasChildren);
}
Aggregations