Search in sources :

Example 1 with ValueMetaBoolean

use of org.apache.hop.core.row.value.ValueMetaBoolean in project hop by apache.

the class CloneRowMeta method getFields.

@Override
public void getFields(IRowMeta rowMeta, String origin, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
    // Output field (boolean) ?
    if (addCloneFlag) {
        String realfieldValue = variables.resolve(cloneFlagField);
        if (!Utils.isEmpty(realfieldValue)) {
            IValueMeta v = new ValueMetaBoolean(realfieldValue);
            v.setOrigin(origin);
            rowMeta.addValueMeta(v);
        }
    }
    // Output clone row number
    if (addCloneNum) {
        String realfieldValue = variables.resolve(cloneNumField);
        if (!Utils.isEmpty(realfieldValue)) {
            IValueMeta v = new ValueMetaInteger(realfieldValue);
            v.setOrigin(origin);
            rowMeta.addValueMeta(v);
        }
    }
}
Also used : IValueMeta(org.apache.hop.core.row.IValueMeta) ValueMetaBoolean(org.apache.hop.core.row.value.ValueMetaBoolean) ValueMetaInteger(org.apache.hop.core.row.value.ValueMetaInteger)

Example 2 with ValueMetaBoolean

use of org.apache.hop.core.row.value.ValueMetaBoolean in project hop by apache.

the class FileExistsMeta method getFields.

@Override
public void getFields(IRowMeta inputRowMeta, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
    // Output fields (String)
    if (!Utils.isEmpty(resultfieldname)) {
        IValueMeta v = new ValueMetaBoolean(variables.resolve(resultfieldname));
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
    if (includefiletype && !Utils.isEmpty(filetypefieldname)) {
        IValueMeta v = new ValueMetaString(variables.resolve(filetypefieldname));
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : IValueMeta(org.apache.hop.core.row.IValueMeta) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString) ValueMetaBoolean(org.apache.hop.core.row.value.ValueMetaBoolean)

Example 3 with ValueMetaBoolean

use of org.apache.hop.core.row.value.ValueMetaBoolean in project hop by apache.

the class MailInputMeta method getFields.

@Override
public void getFields(IRowMeta r, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
    int i;
    for (i = 0; i < inputFields.length; i++) {
        MailInputField field = inputFields[i];
        IValueMeta v = new ValueMetaString(variables.resolve(field.getName()));
        switch(field.getColumn()) {
            case MailInputField.COLUMN_MESSAGE_NR:
            case MailInputField.COLUMN_SIZE:
            case MailInputField.COLUMN_ATTACHED_FILES_COUNT:
                v = new ValueMetaInteger(variables.resolve(field.getName()));
                v.setLength(IValueMeta.DEFAULT_INTEGER_LENGTH, 0);
                break;
            case MailInputField.COLUMN_RECEIVED_DATE:
            case MailInputField.COLUMN_SENT_DATE:
                v = new ValueMetaDate(variables.resolve(field.getName()));
                break;
            case MailInputField.COLUMN_FLAG_DELETED:
            case MailInputField.COLUMN_FLAG_DRAFT:
            case MailInputField.COLUMN_FLAG_FLAGGED:
            case MailInputField.COLUMN_FLAG_NEW:
            case MailInputField.COLUMN_FLAG_READ:
                v = new ValueMetaBoolean(variables.resolve(field.getName()));
                break;
            default:
                // STRING
                v.setLength(250);
                v.setPrecision(-1);
                break;
        }
        v.setOrigin(name);
        r.addValueMeta(v);
    }
}
Also used : IValueMeta(org.apache.hop.core.row.IValueMeta) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString) ValueMetaInteger(org.apache.hop.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.apache.hop.core.row.value.ValueMetaBoolean) ValueMetaDate(org.apache.hop.core.row.value.ValueMetaDate)

Example 4 with ValueMetaBoolean

use of org.apache.hop.core.row.value.ValueMetaBoolean in project hop by apache.

the class GetTableNamesMeta method getFields.

@Override
public void getFields(IRowMeta r, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
    String realtablename = variables.resolve(tablenamefieldname);
    if (!Utils.isEmpty(realtablename)) {
        IValueMeta v = new ValueMetaString(realtablename);
        v.setLength(500);
        v.setPrecision(-1);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
    String realObjectType = variables.resolve(objecttypefieldname);
    if (!Utils.isEmpty(realObjectType)) {
        IValueMeta v = new ValueMetaString(realObjectType);
        v.setLength(500);
        v.setPrecision(-1);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
    String sysobject = variables.resolve(issystemobjectfieldname);
    if (!Utils.isEmpty(sysobject)) {
        IValueMeta v = new ValueMetaBoolean(sysobject);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
    String realSqlCreation = variables.resolve(sqlcreationfieldname);
    if (!Utils.isEmpty(realSqlCreation)) {
        IValueMeta v = new ValueMetaString(realSqlCreation);
        v.setLength(500);
        v.setPrecision(-1);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
}
Also used : IValueMeta(org.apache.hop.core.row.IValueMeta) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString) ValueMetaBoolean(org.apache.hop.core.row.value.ValueMetaBoolean) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString)

Example 5 with ValueMetaBoolean

use of org.apache.hop.core.row.value.ValueMetaBoolean in project hop by apache.

the class FileLockedMeta method getFields.

@Override
public void getFields(IRowMeta inputRowMeta, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider) throws HopTransformException {
    if (!Utils.isEmpty(resultfieldname)) {
        IValueMeta v = new ValueMetaBoolean(resultfieldname);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : IValueMeta(org.apache.hop.core.row.IValueMeta) ValueMetaBoolean(org.apache.hop.core.row.value.ValueMetaBoolean)

Aggregations

ValueMetaBoolean (org.apache.hop.core.row.value.ValueMetaBoolean)23 IValueMeta (org.apache.hop.core.row.IValueMeta)19 ValueMetaString (org.apache.hop.core.row.value.ValueMetaString)12 ValueMetaInteger (org.apache.hop.core.row.value.ValueMetaInteger)8 ValueMetaDate (org.apache.hop.core.row.value.ValueMetaDate)6 IRowMeta (org.apache.hop.core.row.IRowMeta)4 HopTransformException (org.apache.hop.core.exception.HopTransformException)3 RowMeta (org.apache.hop.core.row.RowMeta)3 Database (org.apache.hop.core.database.Database)2 DatabaseMeta (org.apache.hop.core.database.DatabaseMeta)2 HopException (org.apache.hop.core.exception.HopException)2 SQLException (java.sql.SQLException)1 RowMetaAndData (org.apache.hop.core.RowMetaAndData)1 SqlStatement (org.apache.hop.core.SqlStatement)1 HopDatabaseException (org.apache.hop.core.exception.HopDatabaseException)1 HopPluginException (org.apache.hop.core.exception.HopPluginException)1 HopValueException (org.apache.hop.core.exception.HopValueException)1 HopXmlException (org.apache.hop.core.exception.HopXmlException)1