ParseTsvWithHeaderLineFunction.java :  » GWT » itemscript » org » itemscript » template » expression » Java Open Source

Java Open Source » GWT » itemscript 
itemscript » org » itemscript » template » expression » ParseTsvWithHeaderLineFunction.java

package org.itemscript.template.expression;

import org.itemscript.core.JsonSystem;
import org.itemscript.core.exceptions.ItemscriptError;
import org.itemscript.core.util.TsvParser;
import org.itemscript.core.values.JsonValue;
import org.itemscript.template.TemplateExec;

public class ParseTsvWithHeaderLineFunction extends FunctionBase {
    public ParseTsvWithHeaderLineFunction(JsonSystem system) {
        super(system, null);
    }

    //@Override
    public JsonValue execute(TemplateExec template, JsonValue context, JsonValue value) {
        if (value == null || !value.isString()) { throw ItemscriptError.internalError(this,
                "execute.value.was.not.a.JsonString", value + ""); }
        return TsvParser.parseWithHeaderLine(system(), value.stringValue());
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.