本文整理汇总了Java中com.infobright.etl.model.ValueConverter类的典型用法代码示例。如果您正苦于以下问题:Java ValueConverter类的具体用法?Java ValueConverter怎么用?Java ValueConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueConverter类属于com.infobright.etl.model包,在下文中一共展示了ValueConverter类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
byte[] bytes = meta.getBinary(value);
if (bytes == null) {
setIsNull(true);
} else {
setIsNull(false);
if (isCheckValues() && bytes.length > length) {
throw new ValueConverterException("data is too big for this column");
}
data = bytes;
}
}
}
示例2: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Long val = meta.getInteger(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
if (val >= 1L<<7 || val < -(1L<<7)) {
throw new ValueConverterException("Value " + val + " out of range for TINYINT");
}
data = val.byteValue();
}
}
}
示例3: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Long val = meta.getInteger(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
if (val >= 1L<<15 || val < -(1L<<15)) {
throw new ValueConverterException("Value " + val + " out of range for SMALLINT");
}
data = val.shortValue();
}
}
}
示例4: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Long val = meta.getInteger(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
if (val >= 1L<<31 || val < -(1L<<31)) {
throw new ValueConverterException("Value " + val + " out of range for INT");
}
data = val.intValue();
}
}
}
示例5: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Long val = meta.getInteger(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
if (val >= 1L<<23 || val < -(1L<<23)) {
throw new ValueConverterException("Value " + val + " out of range for MEDIUMINT");
}
data = val.intValue();
}
}
}
示例6: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
byte[] bytes = meta.getBinary(value);
if (bytes == null) {
setIsNull(true);
} else {
setIsNull(false);
if (isCheckValues() && bytes.length > length) {
throw new ValueConverterException("data is too big for this column");
}
System.arraycopy(bytes, 0, data, 0, bytes.length);
padZerosStartingAt(bytes.length);
}
}
}
示例7: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Double val = meta.getNumber(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
// possible loss of precision
data = val.floatValue();
}
}
}
示例8: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Date date = meta.getDate(value);
if (date == null) {
setIsNull(true);
} else {
setIsNull(false);
setData(date);
}
}
}
示例9: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Double val = meta.getNumber(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
data = val;
}
}
}
示例10: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
/**
* @throws ValueConverterException if value has too many digits for the
* precision
*/
@Override
public void setData(Object value, ValueConverter meta) {
if (value == null) {
setIsNull(true);
} else {
BigDecimal val = meta.getBigNumber(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
setData(val.multiply(multiplier));
}
}
}
示例11: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
String val = meta.getString(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
setData(val);
}
}
}
示例12: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(Object value, ValueConverter meta)
throws ValueConverterException {
if (value == null) {
setIsNull(true);
} else {
Long val = meta.getInteger(value);
if (val == null) {
setIsNull(true);
} else {
setIsNull(false);
data = val;
}
}
}
示例13: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
@Override
public void setData(int colidx, Object value, ValueConverter meta) throws ValueConverterException {
AbstractColumnType col = columns.get(colidx);
if (value == null) {
col.setIsNull(true);
} else {
col.setIsNull(false);
col.setData(value, meta);
}
}
示例14: setData
import com.infobright.etl.model.ValueConverter; //导入依赖的package包/类
/**
* Sets column data supplied from kettle Value
* @param value
* @throws ValueConverterException
*/
public abstract void setData(Object value, ValueConverter meta) throws ValueConverterException;