Search in sources :

Example 36 with ValueMeta

use of org.pentaho.di.core.row.ValueMeta in project pentaho-kettle by pentaho.

the class GetXMLDataTest method createRowMetaInterface.

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;
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMeta(org.pentaho.di.core.row.ValueMeta) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 37 with ValueMeta

use of org.pentaho.di.core.row.ValueMeta in project pentaho-kettle by pentaho.

the class XsltTest method createRowMetaInterface.

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;
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMeta(org.pentaho.di.core.row.ValueMeta) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 38 with ValueMeta

use of org.pentaho.di.core.row.ValueMeta in project pentaho-kettle by pentaho.

the class XMLOutputMeta method getRequiredFields.

public RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException {
    RowMeta row = new RowMeta();
    for (int i = 0; i < outputFields.length; i++) {
        XMLField field = outputFields[i];
        row.addValueMeta(new ValueMeta(field.getFieldName(), field.getType(), field.getLength(), field.getPrecision()));
    }
    return row;
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) ValueMeta(org.pentaho.di.core.row.ValueMeta)

Example 39 with ValueMeta

use of org.pentaho.di.core.row.ValueMeta in project pentaho-kettle by pentaho.

the class XsdValidatorMeta method getFields.

public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (!Utils.isEmpty(resultFieldname)) {
        if (outputStringField) {
            // Output field (String)
            ValueMetaInterface v = new ValueMeta(space.environmentSubstitute(getResultfieldname()), ValueMeta.TYPE_STRING);
            inputRowMeta.addValueMeta(v);
        } else {
            // Output field (boolean)
            ValueMetaInterface v = new ValueMeta(space.environmentSubstitute(getResultfieldname()), ValueMeta.TYPE_BOOLEAN);
            inputRowMeta.addValueMeta(v);
        }
    }
    // Add String Field that contain validation message (most the time, errors)
    if (addValidationMessage && !Utils.isEmpty(validationMessageField)) {
        ValueMetaInterface v = new ValueMeta(space.environmentSubstitute(validationMessageField), ValueMeta.TYPE_STRING);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : ValueMeta(org.pentaho.di.core.row.ValueMeta) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 40 with ValueMeta

use of org.pentaho.di.core.row.ValueMeta in project pentaho-kettle by pentaho.

the class XsltMeta method getFields.

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);
}
Also used : ValueMeta(org.pentaho.di.core.row.ValueMeta) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

ValueMeta (org.pentaho.di.core.row.ValueMeta)47 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)39 Test (org.junit.Test)18 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)14 IMetaverseNode (org.pentaho.metaverse.api.IMetaverseNode)13 RowMeta (org.pentaho.di.core.row.RowMeta)12 IAnalysisContext (org.pentaho.metaverse.api.IAnalysisContext)8 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)6 KettleValueException (org.pentaho.di.core.exception.KettleValueException)5 MetaverseTransientNode (org.pentaho.dictionary.MetaverseTransientNode)5 IComponentDescriptor (org.pentaho.metaverse.api.IComponentDescriptor)5 KettleException (org.pentaho.di.core.exception.KettleException)4 KettleStepException (org.pentaho.di.core.exception.KettleStepException)4 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)3 Matchers.anyString (org.mockito.Matchers.anyString)2 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2 BatchUpdateException (java.sql.BatchUpdateException)1 Blob (java.sql.Blob)1 ResultSet (java.sql.ResultSet)1