Sha256: 42ae129d0956a2019375db4d105981e9df6d3680118f88f7a499227a32182cd6

Contents?: true

Size: 1.9 KB

Versions: 102

Compression:

Stored size: 1.9 KB

Contents

package com.jrjackson;

import com.fasterxml.jackson.core.JsonParser;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.exceptions.RaiseException;

/**
 *
 * @author Guy Boertje
 */
public abstract class StreamParse {

    protected final ThreadContext _ctx;
    protected final Ruby _ruby;
    protected final IRubyObject _handler;
    protected final RubyClass _meta;
    protected final RubyStringConverter keyConverter = new RubyStringConverter();
    
    protected final DynamicMethod _hash_start;
    protected final boolean _no_hash_start;

    protected final DynamicMethod _hash_end;
    protected final boolean _no_hash_end;

    protected final DynamicMethod _array_start;
    protected final boolean _no_array_start;

    protected final DynamicMethod _array_end;
    protected final boolean _no_array_end;
    
    protected final DynamicMethod _add_value;
    protected final boolean _no_add_value;

    public StreamParse(ThreadContext ctx, IRubyObject handler)
            throws RaiseException {

        _ctx = ctx;
        _ruby = ctx.runtime;
        _handler = handler;
        _meta = _handler.getMetaClass();
        
        _add_value = _meta.searchMethod("add_value");
        _no_add_value = _add_value.isUndefined();

        _hash_start = _meta.searchMethod("hash_start");
        _no_hash_start = _hash_start.isUndefined();

        _hash_end = _meta.searchMethod("hash_end");
        _no_hash_end = _hash_end.isUndefined();

        _array_start = _meta.searchMethod("array_start");
        _no_array_start = _array_start.isUndefined();

        _array_end = _meta.searchMethod("array_end");
        _no_array_end = _array_end.isUndefined();

    }
    
    public abstract IRubyObject deserialize(JsonParser jp) 
            throws RaiseException;
}

Version data entries

102 entries across 90 versions & 17 rubygems

Version Path
jrjackson-0.4.18-java src/main/java/com/jrjackson/StreamParse.java
jrjackson-0.4.17-java src/main/java/com/jrjackson/StreamParse.java
jrjackson-0.4.16-java src/main/java/com/jrjackson/StreamParse.java
jrjackson-0.4.15-java src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.14-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.14-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.14-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.14-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/jrjackson-0.4.8-java/src/main/java/com/jrjackson/StreamParse.java