Sha256: 94164311b9ee24f77a6e2cf47f64dc3c58156227a10403baf54c3f41302a6fe6

Contents?: true

Size: 1.57 KB

Versions: 52

Compression:

Stored size: 1.57 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.FormatterPlugin;
import org.embulk.spi.PageOutput;
import org.embulk.spi.FileOutput;
import org.embulk.spi.Schema;

public class <%= java_class_name %>
        implements FormatterPlugin
{
    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("option2")
        @ConfigDefault("\"myvalue\"")
        public String getOption2();

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

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

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

    @Override
    public PageOutput open(TaskSource taskSource, Schema schema,
            FileOutput output)
    {
        PluginTask task = taskSource.loadTask(PluginTask.class);

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

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
embulk-0.8.18 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.18-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.17 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.17-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.16 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.16-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.15 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.15-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.14 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.14-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.13 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.13-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.12 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.12-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.11-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.11 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.10 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.10-java lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.9 lib/embulk/data/new/java/formatter.java.erb
embulk-0.8.9-java lib/embulk/data/new/java/formatter.java.erb