本文整理汇总了Java中org.pentaho.di.compatibility.Value.getBytes方法的典型用法代码示例。如果您正苦于以下问题:Java Value.getBytes方法的具体用法?Java Value.getBytes怎么用?Java Value.getBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.compatibility.Value
的用法示例。
在下文中一共展示了Value.getBytes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValueData
import org.pentaho.di.compatibility.Value; //导入方法依赖的package包/类
/**
* Extracts the primitive data from an old style Value object
* @param value the old style Value object
* @return the value's data, NOT the meta data.
* @throws KettleValueException case there is a data conversion problem
*/
public Object getValueData(Value value) throws KettleValueException
{
if (value==null || value.isNull()) return null;
// So far the old types and the new types map to the same thing.
// For compatibility we just ask the old-style value to convert to the new one.
// In the old transformation this would happen sooner or later anyway.
// It doesn't throw exceptions or complain either (unfortunately).
//
switch(getType())
{
case ValueMetaInterface.TYPE_STRING : return value.getString();
case ValueMetaInterface.TYPE_NUMBER : return value.getNumber();
case ValueMetaInterface.TYPE_INTEGER : return value.getInteger();
case ValueMetaInterface.TYPE_DATE : return value.getDate();
case ValueMetaInterface.TYPE_BOOLEAN : return value.getBoolean();
case ValueMetaInterface.TYPE_BIGNUMBER : return value.getBigNumber();
case ValueMetaInterface.TYPE_BINARY : return value.getBytes();
// -- Begin GeoKettle modification --
case ValueMetaInterface.TYPE_GEOMETRY : return value.getGeometry();
// -- End GeoKettle modification --
default: throw new KettleValueException(toString()+" : We can't convert original data type "+value.getTypeDesc()+" to a primitive data type");
}
}
示例2: getValueData
import org.pentaho.di.compatibility.Value; //导入方法依赖的package包/类
/**
* Extracts the primitive data from an old style Value object
* @param value the old style Value object
* @return the value's data, NOT the meta data.
* @throws KettleValueException case there is a data conversion problem
*/
public Object getValueData(Value value) throws KettleValueException
{
if (value==null || value.isNull()) return null;
// So far the old types and the new types map to the same thing.
// For compatibility we just ask the old-style value to convert to the new one.
// In the old transformation this would happen sooner or later anyway.
// It doesn't throw exceptions or complain either (unfortunately).
//
switch(getType())
{
case ValueMetaInterface.TYPE_STRING : return value.getString();
case ValueMetaInterface.TYPE_NUMBER : return value.getNumber();
case ValueMetaInterface.TYPE_INTEGER : return value.getInteger();
case ValueMetaInterface.TYPE_DATE : return value.getDate();
case ValueMetaInterface.TYPE_BOOLEAN : return value.getBoolean();
case ValueMetaInterface.TYPE_BIGNUMBER : return value.getBigNumber();
case ValueMetaInterface.TYPE_BINARY : return value.getBytes();
default: throw new KettleValueException(toString()+" : We can't convert original data type "+value.getTypeDesc()+" to a primitive data type");
}
}
示例3: getValueData
import org.pentaho.di.compatibility.Value; //导入方法依赖的package包/类
/**
* Extracts the primitive data from an old style Value object
*
* @param value
* the old style Value object
* @return the value's data, NOT the meta data.
* @throws KettleValueException
* case there is a data conversion problem
*/
public Object getValueData(Value value) throws KettleValueException {
if (value == null || value.isNull())
return null;
// So far the old types and the new types map to the same thing.
// For compatibility we just ask the old-style value to convert to the new
// one.
// In the old transformation this would happen sooner or later anyway.
// It doesn't throw exceptions or complain either (unfortunately).
//
switch (getType()) {
case ValueMetaInterface.TYPE_STRING:
return value.getString();
case ValueMetaInterface.TYPE_NUMBER:
return value.getNumber();
case ValueMetaInterface.TYPE_INTEGER:
return value.getInteger();
case ValueMetaInterface.TYPE_DATE:
return value.getDate();
case ValueMetaInterface.TYPE_BOOLEAN:
return value.getBoolean();
case ValueMetaInterface.TYPE_BIGNUMBER:
return value.getBigNumber();
case ValueMetaInterface.TYPE_BINARY:
return value.getBytes();
default:
throw new KettleValueException(toString() + " : We can't convert original data type " + value.getTypeDesc()
+ " to a primitive data type");
}
}
示例4: getValueData
import org.pentaho.di.compatibility.Value; //导入方法依赖的package包/类
/**
* Extracts the primitive data from an old style Value object
*
* @param value
* the old style Value object
* @return the value's data, NOT the meta data.
* @throws KettleValueException
* case there is a data conversion problem
*/
@Override
public Object getValueData( Value value ) throws KettleValueException {
if ( value == null || value.isNull() ) {
return null;
}
// So far the old types and the new types map to the same thing.
// For compatibility we just ask the old-style value to convert to the new
// one.
// In the old transformation this would happen sooner or later anyway.
// It doesn't throw exceptions or complain either (unfortunately).
//
switch ( getType() ) {
case ValueMetaInterface.TYPE_STRING:
return value.getString();
case ValueMetaInterface.TYPE_NUMBER:
return value.getNumber();
case ValueMetaInterface.TYPE_INTEGER:
return value.getInteger();
case ValueMetaInterface.TYPE_DATE:
return value.getDate();
case ValueMetaInterface.TYPE_BOOLEAN:
return value.getBoolean();
case ValueMetaInterface.TYPE_BIGNUMBER:
return value.getBigNumber();
case ValueMetaInterface.TYPE_BINARY:
return value.getBytes();
default:
throw new KettleValueException( toString() + " : We can't convert original data type " + value.getTypeDesc()
+ " to a primitive data type" );
}
}