Package org.jruby

Examples of org.jruby.RubyClass.defineAnnotatedMethods()


        htmlEntityLookup.defineAnnotatedMethods(HtmlEntityLookup.class);
    }
   
    private void createDocuments(Ruby ruby, RubyModule xmlModule, RubyModule htmlModule, RubyClass node) {
        RubyClass xmlDocument = xmlModule.defineClassUnder("Document", node, XML_DOCUMENT_ALLOCATOR);
        xmlDocument.defineAnnotatedMethods(XmlDocument.class);
       
        //RubyModule htmlDoc = html.defineOrGetClassUnder("Document", document);
        RubyModule htmlDocument = htmlModule.defineClassUnder("Document", xmlDocument, HTML_DOCUMENT_ALLOCATOR);
        htmlDocument.defineAnnotatedMethods(HtmlDocument.class);
    }
View Full Code Here


        htmlDocument.defineAnnotatedMethods(HtmlDocument.class);
    }
   
    private void createSaxModule(Ruby ruby, RubyModule xmlSaxModule, RubyModule htmlSaxModule) {
        RubyClass xmlSaxParserContext = xmlSaxModule.defineClassUnder("ParserContext", ruby.getObject(), XML_SAXPARSER_CONTEXT_ALLOCATOR);
        xmlSaxParserContext.defineAnnotatedMethods(XmlSaxParserContext.class);
       
        RubyClass xmlSaxPushParser = xmlSaxModule.defineClassUnder("PushParser", ruby.getObject(), XML_SAXPUSHPARSER_ALLOCATOR);
        xmlSaxPushParser.defineAnnotatedMethods(XmlSaxPushParser.class);
       
        RubyClass htmlSaxParserContext = htmlSaxModule.defineClassUnder("ParserContext", xmlSaxParserContext, HTML_SAXPARSER_CONTEXT_ALLOCATOR);
View Full Code Here

    private void createSaxModule(Ruby ruby, RubyModule xmlSaxModule, RubyModule htmlSaxModule) {
        RubyClass xmlSaxParserContext = xmlSaxModule.defineClassUnder("ParserContext", ruby.getObject(), XML_SAXPARSER_CONTEXT_ALLOCATOR);
        xmlSaxParserContext.defineAnnotatedMethods(XmlSaxParserContext.class);
       
        RubyClass xmlSaxPushParser = xmlSaxModule.defineClassUnder("PushParser", ruby.getObject(), XML_SAXPUSHPARSER_ALLOCATOR);
        xmlSaxPushParser.defineAnnotatedMethods(XmlSaxPushParser.class);
       
        RubyClass htmlSaxParserContext = htmlSaxModule.defineClassUnder("ParserContext", xmlSaxParserContext, HTML_SAXPARSER_CONTEXT_ALLOCATOR);
        htmlSaxParserContext.defineAnnotatedMethods(HtmlSaxParserContext.class);
    }
   
View Full Code Here

       
        RubyClass xmlSaxPushParser = xmlSaxModule.defineClassUnder("PushParser", ruby.getObject(), XML_SAXPUSHPARSER_ALLOCATOR);
        xmlSaxPushParser.defineAnnotatedMethods(XmlSaxPushParser.class);
       
        RubyClass htmlSaxParserContext = htmlSaxModule.defineClassUnder("ParserContext", xmlSaxParserContext, HTML_SAXPARSER_CONTEXT_ALLOCATOR);
        htmlSaxParserContext.defineAnnotatedMethods(HtmlSaxParserContext.class);
    }
   
    private void createXsltModule(Ruby ruby, RubyModule xsltModule) {
        RubyClass stylesheet = xsltModule.defineClassUnder("Stylesheet", ruby.getObject(), XSLT_STYLESHEET_ALLOCATOR);
        stylesheet.defineAnnotatedMethods(XsltStylesheet.class);
View Full Code Here

        htmlSaxParserContext.defineAnnotatedMethods(HtmlSaxParserContext.class);
    }
   
    private void createXsltModule(Ruby ruby, RubyModule xsltModule) {
        RubyClass stylesheet = xsltModule.defineClassUnder("Stylesheet", ruby.getObject(), XSLT_STYLESHEET_ALLOCATOR);
        stylesheet.defineAnnotatedMethods(XsltStylesheet.class);
        xsltModule.defineAnnotatedMethod(XsltStylesheet.class, "register");
    }

    private static ObjectAllocator ENCODING_HANDLER_ALLOCATOR = new ObjectAllocator() {
        public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
View Full Code Here

      public IRubyObject allocate(Ruby runtime, RubyClass rubyClass) {
        return new WebsocketMask(runtime, rubyClass);
      }
    });

    webSocketMask.defineAnnotatedMethods(WebsocketMask.class);
    return true;
  }

  public class WebsocketMask extends RubyObject {
    public WebsocketMask(final Ruby runtime, RubyClass rubyClass) {
View Full Code Here

  public boolean basicLoad(Ruby runtime) throws IOException {
    RubyModule refModule = runtime.getModule("Ref");
    RubyClass referenceClass = refModule.getClass("Reference");
   
    RubyClass rubyWeakReferenceClass = runtime.defineClassUnder("WeakReference", referenceClass, RubyWeakReference.ALLOCATOR, refModule);
    rubyWeakReferenceClass.defineAnnotatedMethods(RubyWeakReference.class);
   
    RubyClass rubySoftReferenceClass = runtime.defineClassUnder("SoftReference", referenceClass, RubySoftReference.ALLOCATOR, refModule);
    rubySoftReferenceClass.defineAnnotatedMethods(RubySoftReference.class);
   
    return true;
View Full Code Here

   
    RubyClass rubyWeakReferenceClass = runtime.defineClassUnder("WeakReference", referenceClass, RubyWeakReference.ALLOCATOR, refModule);
    rubyWeakReferenceClass.defineAnnotatedMethods(RubyWeakReference.class);
   
    RubyClass rubySoftReferenceClass = runtime.defineClassUnder("SoftReference", referenceClass, RubySoftReference.ALLOCATOR, refModule);
    rubySoftReferenceClass.defineAnnotatedMethods(RubySoftReference.class);
   
    return true;
  }
}
View Full Code Here

    public static void createHttp11(Ruby runtime) {
        RubyModule mMongrel = runtime.defineModule("Mongrel");
        mMongrel.defineClassUnder("HttpParserError",runtime.getClass("IOError"),runtime.getClass("IOError").getAllocator());

        RubyClass cHttpParser = mMongrel.defineClassUnder("HttpParser",runtime.getObject(),ALLOCATOR);
        cHttpParser.defineAnnotatedMethods(Http11.class);
    }

    private Ruby runtime;
    private RubyClass eHttpParserError;
    private Http11Parser hp;
View Full Code Here

public class RubyHttpParserService implements BasicLibraryService {
  public boolean basicLoad(final Ruby runtime) throws IOException {
    RubyModule mHTTP = runtime.defineModule("HTTP");
    RubyClass cParser = mHTTP.defineClassUnder("Parser", runtime.getObject(), RubyHttpParser.ALLOCATOR);
    cParser.defineAnnotatedMethods(RubyHttpParser.class);
    cParser.defineClassUnder("Error", runtime.getClass("IOError"),runtime.getClass("IOError").getAllocator());
    return true;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.