Sha256: 4d0b150e8369b862ad4abd05eee5d87d364b7578749cf6459b359adfb39ed165

Contents?: true

Size: 1.76 KB

Versions: 21

Compression:

Stored size: 1.76 KB

Contents

package <%= java_package_name %>;

import com.google.common.base.Optional;
import org.embulk.config.Config;
import org.embulk.config.ConfigDefault;
import org.embulk.config.ConfigDiff;
import org.embulk.config.ConfigSource;
import org.embulk.config.Task;
import org.embulk.config.TaskSource;
import org.embulk.spi.ParserPlugin;
import org.embulk.spi.FileInput;
import org.embulk.spi.PageOutput;
import org.embulk.spi.Schema;
import org.embulk.spi.SchemaConfig;

public class <%= java_class_name %>
        implements ParserPlugin
{
    public interface PluginTask
            extends Task
    {
        // configuration option 1 (required integer)
        @Config("option1")
        public int getOption1();

        // configuration option 2 (optional string, null is not allowed)
        @Config("optoin2")
        @ConfigDefault("\"myvalue\"")
        public String getOption2();

        // configuration option 3 (optional string, null is allowed)
        @Config("optoin3")
        @ConfigDefault("null")
        public Optional<String> getOption3();

        // if you get schema from config or data source
        @Config("columns")
        public SchemaConfig getColumns();
    }

    @Override
    public void transaction(ConfigSource config, ParserPlugin.Control control)
    {
        PluginTask task = config.loadConfig(PluginTask.class);

        Schema schema = task.getColumns().toSchema();

        control.run(task.dump(), schema);
    }

    @Override
    public void run(TaskSource taskSource, Schema schema,
            FileInput input, PageOutput output)
    {
        PluginTask task = taskSource.loadTask(PluginTask.class);

        // Write your code here :)
        throw new UnsupportedOperationException("<%= java_class_name %>.run method is not implemented yet");
    }
}

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
embulk-0.6.27 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.4 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.4-java lib/embulk/data/new/java/parser.java.erb
embulk-0.7.3 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.3-java lib/embulk/data/new/java/parser.java.erb
embulk-0.7.2 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.2-java lib/embulk/data/new/java/parser.java.erb
embulk-0.6.26 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.1 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.1-java lib/embulk/data/new/java/parser.java.erb
embulk-0.7.0 lib/embulk/data/new/java/parser.java.erb
embulk-0.7.0-java lib/embulk/data/new/java/parser.java.erb
embulk-0.6.25 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.24 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.23 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.22 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.21 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.20 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.19 lib/embulk/data/new/java/parser.java.erb
embulk-0.6.18 lib/embulk/data/new/java/parser.java.erb