Sha256: ca0303185ec2473f6cf95ce99044eccd581e027b8817c0d702339a7d5ed1a1d3

Contents?: true

Size: 1.51 KB

Versions: 3

Compression:

Stored size: 1.51 KB

Contents

package smile.xml;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.compiler.ir.instructions.THROW_EXCEPTION_Instr;

import smile.xml.sax.SaxParserCallbacksJ;
import smile.xml.sax.SaxParserJ;
import smile.xml.xpath.XPathContextJ;
import smile.xml.xpath.XPathExpressionJ;
import smile.xml.xpath.XPathJ;
import smile.xml.xpath.XPathObjectJ;
import smile.xml.xpath.XPointerJ;

public class SmileXML {
	public static void define(Ruby runtime) {
		
		try {
		RubyModule libxml = runtime.fastGetModule("LibXML");
		if (libxml == null) {
			libxml = runtime.defineModule("LibXML");
		}

		RubyModule xml = XmlJ.define(runtime);

		ParserJ.define(runtime);
		ParserContextJ.define(runtime);
		ParserOptionsJ.define(runtime);
		DocumentJ.define(runtime);
		NodeJ.define(runtime);
		NodeSetJ.define(runtime);
		AttributesJ.define(runtime);
		AttrJ.define(runtime);

		SaxParserJ.define(runtime);
		SaxParserCallbacksJ.define(runtime);

		XPathJ.define(runtime);
		XPathObjectJ.define(runtime);
		XPathContextJ.define(runtime);		
		XPathExpressionJ.define(runtime);
		XPointerJ.define(runtime);
		
		EncodingJ.define(runtime);
		
		ErrorJ.define(runtime);

		RubyClass ns = NamespaceJ.define(runtime);
		NamespacesJ.define(runtime);

		SchemaJ.define(runtime);

		runtime.addModule(xml);

		xml.setConstant("NS", ns);
		
		runtime.defineGlobalConstant( "XML", xml );
		
		} catch( RuntimeException e ) {
			e.printStackTrace();
			throw e;
		}
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smile-xml-1.0.3-java src/main/java/smile/xml/SmileXML.java
smile-xml-1.0.3-jruby src/main/java/smile/xml/SmileXML.java
smile-xml-1.0.2-jruby src/main/java/smile/xml/SmileXML.java