Search in sources :

Example 36 with ValueMetaBoolean

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

the class DetectLastRowStepIT method createResultRowMetaInterface.

public RowMetaInterface createResultRowMetaInterface() {
    RowMetaInterface rm = new RowMeta();
    ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6"), new ValueMetaBoolean("result") };
    for (int i = 0; i < valuesMeta.length; i++) {
        rm.addValueMeta(valuesMeta[i]);
    }
    return rm;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 37 with ValueMetaBoolean

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

the class TableExistsMeta method getFields.

public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    // Output field (String)
    if (!Utils.isEmpty(resultfieldname)) {
        ValueMetaInterface v = new ValueMetaBoolean(space.environmentSubstitute(resultfieldname));
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 38 with ValueMetaBoolean

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

the class TextFileInputMeta method getFields.

@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (!isPassingThruFields()) {
        // all incoming fields are not transmitted !
        row.clear();
    } else {
        if (info != null) {
            boolean found = false;
            for (int i = 0; i < info.length && !found; i++) {
                if (info[i] != null) {
                    row.mergeRowMeta(info[i]);
                    found = true;
                }
            }
        }
    }
    for (int i = 0; i < inputFields.length; i++) {
        TextFileInputField field = inputFields[i];
        int type = field.getType();
        if (type == ValueMetaInterface.TYPE_NONE) {
            type = ValueMetaInterface.TYPE_STRING;
        }
        try {
            ValueMetaInterface v = ValueMetaFactory.createValueMeta(field.getName(), type);
            v.setLength(field.getLength());
            v.setPrecision(field.getPrecision());
            v.setOrigin(name);
            v.setConversionMask(field.getFormat());
            v.setDecimalSymbol(field.getDecimalSymbol());
            v.setGroupingSymbol(field.getGroupSymbol());
            v.setCurrencySymbol(field.getCurrencySymbol());
            v.setDateFormatLenient(dateFormatLenient);
            v.setDateFormatLocale(dateFormatLocale);
            v.setTrimType(field.getTrimType());
            row.addValueMeta(v);
        } catch (Exception e) {
            throw new KettleStepException(e);
        }
    }
    if (errorIgnored) {
        if (errorCountField != null && errorCountField.length() > 0) {
            ValueMetaInterface v = new ValueMetaInteger(errorCountField);
            v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
            v.setOrigin(name);
            row.addValueMeta(v);
        }
        if (errorFieldsField != null && errorFieldsField.length() > 0) {
            ValueMetaInterface v = new ValueMetaString(errorFieldsField);
            v.setOrigin(name);
            row.addValueMeta(v);
        }
        if (errorTextField != null && errorTextField.length() > 0) {
            ValueMetaInterface v = new ValueMetaString(errorTextField);
            v.setOrigin(name);
            row.addValueMeta(v);
        }
    }
    if (includeFilename) {
        ValueMetaInterface v = new ValueMetaString(filenameField);
        v.setLength(100);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (includeRowNumber) {
        ValueMetaInterface v = new ValueMetaInteger(rowNumberField);
        v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getShortFileNameField() != null && getShortFileNameField().length() > 0) {
        ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(getShortFileNameField()));
        v.setLength(100, -1);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getExtensionField() != null && getExtensionField().length() > 0) {
        ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(getExtensionField()));
        v.setLength(100, -1);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getPathField() != null && getPathField().length() > 0) {
        ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(getPathField()));
        v.setLength(100, -1);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getSizeField() != null && getSizeField().length() > 0) {
        ValueMetaInterface v = new ValueMetaInteger(space.environmentSubstitute(getSizeField()));
        v.setOrigin(name);
        v.setLength(9);
        row.addValueMeta(v);
    }
    if (isHiddenField() != null && isHiddenField().length() > 0) {
        ValueMetaInterface v = new ValueMetaBoolean(space.environmentSubstitute(isHiddenField()));
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getLastModificationDateField() != null && getLastModificationDateField().length() > 0) {
        ValueMetaInterface v = new ValueMetaDate(space.environmentSubstitute(getLastModificationDateField()));
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getUriField() != null && getUriField().length() > 0) {
        ValueMetaInterface v = new ValueMetaString(space.environmentSubstitute(getUriField()));
        v.setLength(100, -1);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
    if (getRootUriField() != null && getRootUriField().length() > 0) {
        ValueMetaInterface v = new ValueMetaString(getRootUriField());
        v.setLength(100, -1);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) KettleStepException(org.pentaho.di.core.exception.KettleStepException) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 39 with ValueMetaBoolean

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

the class UpdateMeta method getFields.

@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (ignoreFlagField != null && ignoreFlagField.length() > 0) {
        ValueMetaInterface v = new ValueMetaBoolean(ignoreFlagField);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
}
Also used : ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 40 with ValueMetaBoolean

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

the class WebServiceAvailableMeta 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)) {
        ValueMetaInterface v = new ValueMetaBoolean(resultfieldname);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)84 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)68 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)60 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)46 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)44 ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)32 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)25 RowMeta (org.pentaho.di.core.row.RowMeta)22 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)20 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)20 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)18 Test (org.junit.Test)16 ValueMetaInternetAddress (org.pentaho.di.core.row.value.ValueMetaInternetAddress)15 KettleException (org.pentaho.di.core.exception.KettleException)13 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)13 ObjectId (org.pentaho.di.repository.ObjectId)12 LongObjectId (org.pentaho.di.repository.LongObjectId)9 KettleStepException (org.pentaho.di.core.exception.KettleStepException)8 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)7 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)6