当前位置: 首页>>代码示例>>Java>>正文


Java ValueConverter类代码示例

本文整理汇总了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;
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:19,代码来源:VarbinaryType.java

示例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();
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:19,代码来源:TinyintType.java

示例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();
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:19,代码来源:SmallintType.java

示例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();
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:19,代码来源:IntegerType.java

示例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();
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:19,代码来源:MediumintType.java

示例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);
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:20,代码来源:BinaryType.java

示例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();
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:17,代码来源:FloatType.java

示例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);
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:16,代码来源:DateType.java

示例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;
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:16,代码来源:DoubleType.java

示例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));
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:19,代码来源:DecimalType.java

示例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);
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:16,代码来源:VarcharType.java

示例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;
    }
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:16,代码来源:BigintType.java

示例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);
  }
}
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:11,代码来源:TeradataBinaryRecord.java

示例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;
 
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:7,代码来源:AbstractColumnType.java


注:本文中的com.infobright.etl.model.ValueConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。