• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Value类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pentaho.di.compatibility.Value的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Value类属于org.pentaho.di.compatibility包,在下文中一共展示了Value类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
   }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:ValueMeta.java


示例2: createOriginalValue

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
/**
 * Create an old-style value for backward compatibility reasons
 * @param data the data to store in the value
 * @return a newly created Value object
 * @throws KettleValueException  case there is a data conversion problem
 */
public Value createOriginalValue(Object data) throws KettleValueException
{
   Value value = new Value(name, type);
   value.setLength(length, precision);
   
   if (isNull(data))
   {
       value.setNull();
   }
   else
   {
       switch(value.getType())
       {
       case TYPE_STRING       : value.setValue( getString(data) ); break;
       case TYPE_NUMBER       : value.setValue( getNumber(data).doubleValue() ); break;
       case TYPE_INTEGER      : value.setValue( getInteger(data).longValue() ); break;
       case TYPE_DATE         : value.setValue( getDate(data) ); break;
       case TYPE_BOOLEAN      : value.setValue( getBoolean(data).booleanValue() ); break;
       case TYPE_BIGNUMBER    : value.setValue( getBigNumber(data) ); break;
       case TYPE_BINARY       : value.setValue( getBinary(data) ); break;
       default: throw new KettleValueException(toString()+" : We can't convert data type "+getTypeDesc()+" to an original (V2) Value");
       }
   }
   return value;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:ValueMeta.java


示例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");
   }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:29,代码来源:ValueMeta.java


示例4: jsToString

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
public static String jsToString( Object value, String classType ) {
  if ( classType.equalsIgnoreCase( "org.mozilla.javascript.NativeJavaObject" )
    || classType.equalsIgnoreCase( "org.mozilla.javascript.Undefined" ) ) {
    // Is it a java Value class ?
    try {
      Value v = (Value) Context.jsToJava( value, Value.class );
      return v.toString();
    } catch ( Exception ev ) {
      // convert to a string should work in most cases...
      //
      return Context.toString( value );
    }
  } else {
    // A String perhaps?
    return Context.toString( value );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:JavaScriptUtils.java


示例5: createOriginalValue

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
/**
 * Create an old-style value for backward compatibility reasons
 * @param data the data to store in the value
 * @return a newly created Value object
 * @throws KettleValueException  case there is a data conversion problem
 */
public Value createOriginalValue(Object data) throws KettleValueException
{
   Value value = new Value(name, type);
   value.setLength(length, precision);
   
   if (isNull(data))
   {
       value.setNull();
   }
   else
   {
       switch(value.getType())
       {
       case TYPE_STRING       : value.setValue( getString(data) ); break;
       case TYPE_NUMBER       : value.setValue( getNumber(data).doubleValue() ); break;
       case TYPE_INTEGER      : value.setValue( getInteger(data).longValue() ); break;
       case TYPE_DATE         : value.setValue( getDate(data) ); break;
       case TYPE_BOOLEAN      : value.setValue( getBoolean(data).booleanValue() ); break;
       case TYPE_BIGNUMBER    : value.setValue( getBigNumber(data) ); break;
       case TYPE_BINARY       : value.setValue( getBinary(data) ); break;
       // -- Begin GeoKettle modification --
       case TYPE_GEOMETRY     : value.setValue( getGeometry(data) ); break;
       // -- End GeoKettle modification --
       default: throw new KettleValueException(toString()+" : We can't convert data type "+getTypeDesc()+" to an original (V2) Value");
       }
   }
   return value;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:35,代码来源:ValueMeta.java


示例6: createOriginalRow

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
public static Row createOriginalRow(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException {
	Row row = new Row();
	
	for (int i=0;i<rowMeta.size();i++) {
		ValueMetaInterface valueMeta = rowMeta.getValueMeta(i);
		Object valueData = rowData[i];
		
		Value value = valueMeta.createOriginalValue(valueData);
		row.addValue(value);
	}
	
	return row;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:14,代码来源:RowMeta.java


示例7: setAttributeField

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
private void setAttributeField(Attribute attribute, IProgressMonitor monitor)
{
	// Get Attribute Name
	String attributname=attribute.getName();
	String attributnametxt=cleanString(attribute.getPath());
	if(!Const.isEmpty(attributnametxt) && !list.contains(attribute.getPath()))
	{
		 nr++;
		 monitor.subTask(BaseMessages.getString(PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.FetchFields", String.valueOf(nr)));
		 monitor.subTask(BaseMessages.getString(PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.AddingField",attributname));
		
		RowMetaAndData row = new RowMetaAndData();
		row.addValue(VALUE_NAME, Value.VALUE_TYPE_STRING, attributname);
		row.addValue(VALUE_PATH, Value.VALUE_TYPE_STRING, attributnametxt);
		row.addValue(VALUE_ELEMENT, Value.VALUE_TYPE_STRING, GetXMLDataField.ElementTypeDesc[1]);
		row.addValue(VALUE_RESULT, Value.VALUE_TYPE_STRING, GetXMLDataField.ResultTypeDesc[0]);
		 
           // Get attribute value
           String valueAttr =attribute.getText();
           
           // Try to get the Type

           if(IsDate(valueAttr)) {
   			row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "Date");
   			row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, "yyyy/MM/dd");
           }  else if(IsInteger(valueAttr)) {
       		row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "Integer");
   			row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, null);
           } else if(IsNumber(valueAttr)) {
       		row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "Number");
   			row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, null);
           } else {
       		row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "String");
       		row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, null);
           }
           list.add(attribute.getPath());
	}// end if
            
            
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:41,代码来源:XMLInputFieldsImportProgressDialog.java


示例8: createOriginalValue

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
/**
 * Create an old-style value for backward compatibility reasons
 * 
 * @param data
 *          the data to store in the value
 * @return a newly created Value object
 * @throws KettleValueException
 *           case there is a data conversion problem
 */
public Value createOriginalValue(Object data) throws KettleValueException {
  Value value = new Value(name, type);
  value.setLength(length, precision);

  if (isNull(data)) {
    value.setNull();
  } else {
    switch (value.getType()) {
    case TYPE_STRING:
      value.setValue(getString(data));
      break;
    case TYPE_NUMBER:
      value.setValue(getNumber(data).doubleValue());
      break;
    case TYPE_INTEGER:
      value.setValue(getInteger(data).longValue());
      break;
    case TYPE_DATE:
      value.setValue(getDate(data));
      break;
    case TYPE_BOOLEAN:
      value.setValue(getBoolean(data).booleanValue());
      break;
    case TYPE_BIGNUMBER:
      value.setValue(getBigNumber(data));
      break;
    case TYPE_BINARY:
      value.setValue(getBinary(data));
      break;
    default:
      throw new KettleValueException(toString() + " : We can't convert data type " + getTypeDesc()
          + " to an original (V2) Value");
    }
  }
  return value;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:46,代码来源:ValueMetaBase.java


示例9: 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");
  }
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:41,代码来源:ValueMetaBase.java


示例10: jsToInteger

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
public static Long jsToInteger( Object value, Class<?> clazz ) {
  if ( Number.class.isAssignableFrom( clazz ) ) {
    return ( (Number) value ).longValue();
  } else {
    String classType = clazz.getName();
    if ( classType.equalsIgnoreCase( "java.lang.String" ) ) {
      return ( new Long( (String) value ) );
    } else if ( classType.equalsIgnoreCase( "org.mozilla.javascript.Undefined" ) ) {
      return null;
    } else if ( classType.equalsIgnoreCase( "org.mozilla.javascript.NativeNumber" ) ) {
      Number nb = Context.toNumber( value );
      return nb.longValue();
    } else if ( classType.equalsIgnoreCase( "org.mozilla.javascript.NativeJavaObject" ) ) {
      // Is it a Value?
      //
      try {
        Value v = (Value) Context.jsToJava( value, Value.class );
        return v.getInteger();
      } catch ( Exception e2 ) {
        String string = Context.toString( value );
        return Long.parseLong( Const.trim( string ) );
      }
    } else {
      return Long.parseLong( value.toString() );
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:28,代码来源:JavaScriptUtils.java


示例11: jsToBigNumber

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
public static BigDecimal jsToBigNumber( Object value, String classType ) {
  if ( classType.equalsIgnoreCase( "org.mozilla.javascript.Undefined" ) ) {
    return null;
  } else if ( classType.equalsIgnoreCase( "org.mozilla.javascript.NativeNumber" ) ) {
    Number nb = Context.toNumber( value );
    return new BigDecimal( nb.doubleValue() );
  } else if ( classType.equalsIgnoreCase( "org.mozilla.javascript.NativeJavaObject" ) ) {
    // Is it a BigDecimal class ?
    try {
      return (BigDecimal) Context.jsToJava( value, BigDecimal.class );
    } catch ( Exception e ) {
      try {
        Value v = (Value) Context.jsToJava( value, Value.class );
        if ( !v.isNull() ) {
          return v.getBigNumber();
        } else {
          return null;
        }
      } catch ( Exception e2 ) {
        String string = (String) Context.jsToJava( value, String.class );
        return new BigDecimal( string );
      }
    }
  } else if ( classType.equalsIgnoreCase( "java.lang.Byte" ) ) {
    return new BigDecimal( ( (Byte) value ).longValue() );
  } else if ( classType.equalsIgnoreCase( "java.lang.Short" ) ) {
    return new BigDecimal( ( (Short) value ).longValue() );
  } else if ( classType.equalsIgnoreCase( "java.lang.Integer" ) ) {
    return new BigDecimal( ( (Integer) value ).longValue() );
  } else if ( classType.equalsIgnoreCase( "java.lang.Long" ) ) {
    return new BigDecimal( ( (Long) value ).longValue() );
  } else if ( classType.equalsIgnoreCase( "java.lang.Double" ) ) {
    return new BigDecimal( ( (Double) value ).doubleValue() );
  } else if ( classType.equalsIgnoreCase( "java.lang.String" ) ) {
    return new BigDecimal( ( new Long( (String) value ) ).longValue() );
  } else {
    throw new RuntimeException( "JavaScript conversion to BigNumber not implemented for " + classType );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:40,代码来源:JavaScriptUtils.java


示例12: jsToBigNumber_NativeJavaObject_BigDecimal

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
@Test
public void jsToBigNumber_NativeJavaObject_BigDecimal() throws Exception {
  Value value = new Value();
  value.setValue( BigDecimal.ONE );
  Scriptable object = Context.toObject( value, scope );
  assertEquals( 1.0, JavaScriptUtils.jsToBigNumber( object, JAVA_OBJECT ).doubleValue(), 1e-6 );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:JavaScriptUtilsTest.java


示例13: createOriginalValue

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
/**
 * Create an old-style value for backward compatibility reasons
 *
 * @param data
 *          the data to store in the value
 * @return a newly created Value object
 * @throws KettleValueException
 *           case there is a data conversion problem
 */
@Override
public Value createOriginalValue( Object data ) throws KettleValueException {
  Value value = new Value( name, type );
  value.setLength( length, precision );

  if ( isNull( data ) ) {
    value.setNull();
  } else {
    switch ( value.getType() ) {
      case TYPE_STRING:
        value.setValue( getString( data ) );
        break;
      case TYPE_NUMBER:
        value.setValue( getNumber( data ).doubleValue() );
        break;
      case TYPE_INTEGER:
        value.setValue( getInteger( data ).longValue() );
        break;
      case TYPE_DATE:
        value.setValue( getDate( data ) );
        break;
      case TYPE_BOOLEAN:
        value.setValue( getBoolean( data ).booleanValue() );
        break;
      case TYPE_BIGNUMBER:
        value.setValue( getBigNumber( data ) );
        break;
      case TYPE_BINARY:
        value.setValue( getBinary( data ) );
        break;
      default:
        throw new KettleValueException( toString() + " : We can't convert data type " + getTypeDesc()
            + " to an original (V2) Value" );
    }
  }
  return value;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:47,代码来源:ValueMetaBase.java


示例14: 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" );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:43,代码来源:ValueMetaBase.java


示例15: createOriginalRow

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
public static Row createOriginalRow( RowMetaInterface rowMeta, Object[] rowData ) throws KettleValueException {
  Row row = new Row();

  for ( int i = 0; i < rowMeta.size(); i++ ) {
    ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );
    Object valueData = rowData[ i ];

    Value value = valueMeta.createOriginalValue( valueData );
    row.addValue( value );
  }

  return row;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:14,代码来源:RowMeta.java


示例16: setAttributeField

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
private void setAttributeField( Attribute attribute, IProgressMonitor monitor ) {
  // Get Attribute Name
  String attributname = attribute.getName();
  String attributnametxt = cleanString( attribute.getPath() );
  if ( !Utils.isEmpty( attributnametxt ) && !list.contains( attribute.getPath() ) ) {
    nr++;
    monitor.subTask( BaseMessages.getString( PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.FetchFields",
        String.valueOf( nr ) ) );
    monitor.subTask( BaseMessages.getString( PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.AddingField",
        attributname ) );

    RowMetaAndData row = new RowMetaAndData();
    row.addValue( VALUE_NAME, Value.VALUE_TYPE_STRING, attributname );
    row.addValue( VALUE_PATH, Value.VALUE_TYPE_STRING, attributnametxt );
    row.addValue( VALUE_ELEMENT, Value.VALUE_TYPE_STRING, GetXMLDataField.ElementTypeDesc[1] );
    row.addValue( VALUE_RESULT, Value.VALUE_TYPE_STRING, GetXMLDataField.ResultTypeDesc[0] );

    // Get attribute value
    String valueAttr = attribute.getText();

    // Try to get the Type

    if ( IsDate( valueAttr ) ) {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "Date" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, "yyyy/MM/dd" );
    } else if ( IsInteger( valueAttr ) ) {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "Integer" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
    } else if ( IsNumber( valueAttr ) ) {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "Number" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
    } else {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "String" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
    }
    list.add( attribute.getPath() );
  } // end if

}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:40,代码来源:XMLInputFieldsImportProgressDialog.java


示例17: setNodeField

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void setNodeField(Node node, IProgressMonitor monitor)
{
	Element e = (Element) node; 
	// get all attributes
	List<Attribute> lista = e.attributes(); 
	for(int i=0;i<lista.size();i++)
	{
		 setAttributeField(lista.get(i), monitor);
	}

	// Get Node Name
	String nodename=node.getName();
	String nodenametxt=cleanString(node.getPath());
	
	if(!Const.isEmpty(nodenametxt) && !list.contains(nodenametxt))
	{	
		 nr++;
		 monitor.subTask(BaseMessages.getString(PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.FetchFields", String.valueOf(nr)));
		 monitor.subTask(BaseMessages.getString(PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.AddingField",nodename));
	
		 RowMetaAndData row = new RowMetaAndData();
		 row.addValue(VALUE_NAME, Value.VALUE_TYPE_STRING, nodename);
		 row.addValue(VALUE_PATH, Value.VALUE_TYPE_STRING, nodenametxt);
		 row.addValue(VALUE_ELEMENT, Value.VALUE_TYPE_STRING, GetXMLDataField.ElementTypeDesc[0]);
		 row.addValue(VALUE_RESULT, Value.VALUE_TYPE_STRING, GetXMLDataField.ResultTypeDesc[0]);

           // Get Node value
           String valueNode=node.getText();
           
		// Try to get the Type

           if(IsDate(valueNode)) {
   			row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "Date");
   			row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING,  "yyyy/MM/dd");
           } else if(IsInteger(valueNode)) {
           	row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "Integer");
   			row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, null);
           } else if(IsNumber(valueNode)) {
            	row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "Number");   		
       		row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, null);
           } else {
            	row.addValue(VALUE_TYPE, Value.VALUE_TYPE_STRING, "String");  
       		row.addValue(VALUE_FORMAT, Value.VALUE_TYPE_STRING, null);
           }
           fieldsList.add(row);
           list.add(nodenametxt);
          
	}// end if
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:51,代码来源:XMLInputFieldsImportProgressDialog.java


示例18: getIntValue

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
private static Scriptable getIntValue() {
  Value value = new Value();
  value.setValue( 1 );
  return Context.toObject( value, scope );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:6,代码来源:JavaScriptUtilsTest.java


示例19: getDoubleValue

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
private static Scriptable getDoubleValue() {
  Value value = new Value();
  value.setValue( 1.0 );
  return Context.toObject( value, scope );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:6,代码来源:JavaScriptUtilsTest.java


示例20: setNodeField

import org.pentaho.di.compatibility.Value; //导入依赖的package包/类
@SuppressWarnings( "unchecked" )
private void setNodeField( Node node, IProgressMonitor monitor ) {
  Element e = (Element) node;
  // get all attributes
  List<Attribute> lista = e.attributes();
  for ( int i = 0; i < lista.size(); i++ ) {
    setAttributeField( lista.get( i ), monitor );
  }

  // Get Node Name
  String nodename = node.getName();
  String nodenametxt = cleanString( node.getPath() );

  if ( !Utils.isEmpty( nodenametxt ) && !list.contains( nodenametxt ) ) {
    nr++;
    monitor.subTask( BaseMessages.getString( PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.FetchFields",
        String.valueOf( nr ) ) );
    monitor.subTask( BaseMessages.getString( PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.AddingField",
        nodename ) );

    RowMetaAndData row = new RowMetaAndData();
    row.addValue( VALUE_NAME, Value.VALUE_TYPE_STRING, nodename );
    row.addValue( VALUE_PATH, Value.VALUE_TYPE_STRING, nodenametxt );
    row.addValue( VALUE_ELEMENT, Value.VALUE_TYPE_STRING, GetXMLDataField.ElementTypeDesc[0] );
    row.addValue( VALUE_RESULT, Value.VALUE_TYPE_STRING, GetXMLDataField.ResultTypeDesc[0] );

    // Get Node value
    String valueNode = node.getText();

    // Try to get the Type

    if ( IsDate( valueNode ) ) {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "Date" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, "yyyy/MM/dd" );
    } else if ( IsInteger( valueNode ) ) {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "Integer" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
    } else if ( IsNumber( valueNode ) ) {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "Number" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
    } else {
      row.addValue( VALUE_TYPE, Value.VALUE_TYPE_STRING, "String" );
      row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
    }
    fieldsList.add( row );
    list.add( nodenametxt );

  } // end if
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:50,代码来源:XMLInputFieldsImportProgressDialog.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LazyParseablePsiElement类代码示例发布时间:2022-05-23
下一篇:
Java CompositeClassLoader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap