Java Code Examples for org.pentaho.di.core.row.ValueMeta#TYPE_STRING

The following examples show how to use org.pentaho.di.core.row.ValueMeta#TYPE_STRING . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeConverterFactory.java    From pentaho-hadoop-shims with Apache License 2.0 5 votes vote down vote up
/**
 * Attempt to determine the Java {@link Class} for the {@link ValueMetaInterface} provided
 *
 * @param vmi Value Meta with type information to look up
 * @return the class that represents the type {@link ValueMetaInterface} represents; {@code null} if no type can be
 * matched.
 */
public Class<?> getJavaClass( ValueMetaInterface vmi ) {
  Class<?> metaClass = null;

  switch ( vmi.getType() ) {
    case ValueMeta.TYPE_BIGNUMBER:
      metaClass = BigDecimal.class;
      break;
    case ValueMeta.TYPE_BINARY:
      metaClass = byte[].class;
      break;
    case ValueMeta.TYPE_BOOLEAN:
      metaClass = Boolean.class;
      break;
    case ValueMeta.TYPE_DATE:
      metaClass = Date.class;
      break;
    case ValueMeta.TYPE_INTEGER:
      metaClass = Long.class;
      break;
    case ValueMeta.TYPE_NUMBER:
      metaClass = Double.class;
      break;
    case ValueMeta.TYPE_STRING:
      metaClass = String.class;
      break;
    case ValueMeta.TYPE_SERIALIZABLE:
      metaClass = Object.class;
      break;
  }

  return metaClass;
}
 
Example 2
Source File: XsltMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  // Output field (String)
  ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getResultfieldname() ), ValueMeta.TYPE_STRING );
  v.setOrigin( name );
  inputRowMeta.addValueMeta( v );
}
 
Example 3
Source File: XMLOutputDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the output width to minimal width...
 * 
 */
public void setMinimalWidth() {
  int nrNonEmptyFields = wFields.nrNonEmpty();
  for ( int i = 0; i < nrNonEmptyFields; i++ ) {
    TableItem item = wFields.getNonEmpty( i );

    item.setText( 5, "" );
    item.setText( 6, "" );

    int type = ValueMeta.getType( item.getText( 2 ) );
    switch ( type ) {
      case ValueMeta.TYPE_STRING:
        item.setText( 4, "" );
        break;
      case ValueMeta.TYPE_INTEGER:
        item.setText( 4, "0" );
        break;
      case ValueMeta.TYPE_NUMBER:
        item.setText( 4, "0.#####" );
        break;
      case ValueMeta.TYPE_DATE:
        break;
      default:
        break;
    }
  }
  wFields.optWidth( true );
}
 
Example 4
Source File: XsltTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public RowMetaInterface createRowMetaInterface() {
  RowMetaInterface rm = new RowMeta();

  ValueMetaInterface[] valuesMeta =
      { new ValueMeta( "XML", ValueMeta.TYPE_STRING ), new ValueMeta( "XSL", ValueMeta.TYPE_STRING ),
        new ValueMeta( "filename", ValueMeta.TYPE_STRING ), };

  for ( int i = 0; i < valuesMeta.length; i++ ) {
    rm.addValueMeta( valuesMeta[i] );
  }

  return rm;
}
 
Example 5
Source File: XsltTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public RowMetaInterface createResultRowMetaInterface() {
  RowMetaInterface rm = new RowMeta();

  ValueMetaInterface[] valuesMeta =
      { new ValueMeta( "XML", ValueMeta.TYPE_STRING ), new ValueMeta( "XSL", ValueMeta.TYPE_STRING ),
        new ValueMeta( "filename", ValueMeta.TYPE_STRING ), new ValueMeta( "result", ValueMeta.TYPE_STRING ), };

  for ( int i = 0; i < valuesMeta.length; i++ ) {
    rm.addValueMeta( valuesMeta[i] );
  }

  return rm;
}
 
Example 6
Source File: GetXMLDataTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public RowMetaInterface createRowMetaInterface() {
  RowMetaInterface rm = new RowMeta();

  ValueMetaInterface[] valuesMeta = { new ValueMeta( "field1", ValueMeta.TYPE_STRING ) };

  for ( int i = 0; i < valuesMeta.length; i++ ) {
    rm.addValueMeta( valuesMeta[i] );
  }

  return rm;
}
 
Example 7
Source File: GetXMLDataTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public RowMetaInterface createResultRowMetaInterface() {
  RowMetaInterface rm = new RowMeta();

  ValueMetaInterface[] valuesMeta =
    { new ValueMeta( "field1", ValueMeta.TYPE_STRING ), new ValueMeta( "objectid", ValueMeta.TYPE_STRING ),
      new ValueMeta( "sapident", ValueMeta.TYPE_STRING ), new ValueMeta( "quantity", ValueMeta.TYPE_STRING ),
      new ValueMeta( "merkmalname", ValueMeta.TYPE_STRING ), new ValueMeta( "merkmalswert", ValueMeta.TYPE_STRING ) };

  for ( int i = 0; i < valuesMeta.length; i++ ) {
    rm.addValueMeta( valuesMeta[i] );
  }

  return rm;
}
 
Example 8
Source File: XMLInputSaxField.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public XMLInputSaxField( String fieldname, XMLInputSaxFieldPosition[] xmlInputFieldPositions ) {
  this.name = fieldname;
  this.fieldPosition = xmlInputFieldPositions;
  this.length = -1;
  this.type = ValueMeta.TYPE_STRING;
  this.format = "";
  this.trimtype = TYPE_TRIM_NONE;
  this.groupSymbol = "";
  this.decimalSymbol = "";
  this.currencySymbol = "";
  this.precision = -1;
  this.repeat = false;
}
 
Example 9
Source File: XMLInputField.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public XMLInputField( String fieldname, XMLInputFieldPosition[] xmlInputFieldPositions ) {
  this.name = fieldname;
  this.fieldPosition = xmlInputFieldPositions;
  this.length = -1;
  this.type = ValueMeta.TYPE_STRING;
  this.format = "";
  this.trimtype = TYPE_TRIM_NONE;
  this.groupSymbol = "";
  this.decimalSymbol = "";
  this.currencySymbol = "";
  this.precision = -1;
  this.repeat = false;
}