本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface类的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface类的具体用法?Java ValueMetaInterface怎么用?Java ValueMetaInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValueMetaInterface类属于org.pentaho.di.core.row包,在下文中一共展示了ValueMetaInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transToTxt
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
/**
* <br/>
* @author jingma
* @param object
* @param ti
* @param outputRow
* @return
*/
private String transToTxt(Object object, JSONObject ti, Object[] outputRow) {
List<String> efs = getEfs(ti);
JSONObject dataObj = ti.getJSONObject(TRANS_RULE_DATA);
String fgf = dataObj.getString(TRANS_RULE_DATA_FGF);
String fbf = dataObj.getString(TRANS_RULE_DATA_FBF);
StringBuffer buff = new StringBuffer();
for(ValueMetaInterface om:data.outputRowMeta.getValueMetaList()){
if(!ti.getString(TRANS_FIELD).equalsIgnoreCase(om.getName())&&!efs.contains(om.getName())){
Object obj = outputRow[getFieldIndex(om.getName())];
if(obj==null){
obj = "";
}
buff.append(fbf+obj+fbf+fgf);
}
}
String result = buff.substring(0, buff.length()-fgf.length());
outputRow[getFieldIndex(ti)] = result;
return result;
}
示例2: addTableView
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
private void addTableView() {
int margin = Const.MARGIN;
ColumnInfo[] colinf = new ColumnInfo[rowMeta.size()];
for ( int i = 0; i < rowMeta.size(); i++ ) {
ValueMetaInterface v = rowMeta.getValueMeta( i );
colinf[i] = new ColumnInfo( v.getName(), ColumnInfo.COLUMN_TYPE_TEXT, v.isNumeric() );
colinf[i].setToolTip( v.toStringMeta() );
colinf[i].setValueMeta( v );
}
wSeriesTable =
new TableView( variables, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0, null, props );
wSeriesTable.setShowingBlueNullValues( true ); //// TODO: 25/05/16 wat?
fdSeriesTable = new FormData();
fdSeriesTable.left = new FormAttachment( 0, 0 );
fdSeriesTable.top = new FormAttachment( 0, margin );
fdSeriesTable.right = new FormAttachment( 100, 0 );
fdSeriesTable.bottom = new FormAttachment( 100, -50 );
wSeriesTable.setLayoutData( fdSeriesTable );
fillTableView();
}
示例3: getFields
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
/**
* This method is called to determine the changes the step is making to the row-stream.
* To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
* the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
* row-stream.
*
* @param inputRowMeta the row structure coming in to the step
* @param name the name of the step making the changes
* @param info row structures of any info steps coming in
* @param nextStep the description of a step this step is passing rows to
* @param space the variable space for resolving variables
* @param repository the repository instance optionally read from
* @param metaStore the metaStore to optionally read from
*/
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
for ( int i = 0; i < fields.length; i++ ) {
int type = fields[i].getType();
if ( type == ValueMetaInterface.TYPE_NONE) type = ValueMetaInterface.TYPE_STRING;
try {
ValueMetaInterface v = ValueMetaFactory.createValueMeta( fields[i].getName(), type );
v.setConversionMask( fields[i].getFormat() );
v.setLength( fields[i].getLength() );
v.setPrecision( fields[i].getPrecision() );
v.setCurrencySymbol( fields[i].getCurrencySymbol() );
v.setDecimalSymbol( fields[i].getDecimalSymbol() );
v.setGroupingSymbol( fields[i].getGroupSymbol() );
v.setTrimType( fields[i].getTrimType() );
v.setOrigin( name );
inputRowMeta.addValueMeta( v );
} catch (KettlePluginException e) {
throw new KettleStepException( e );
}
}
}
示例4: getFields
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
// Optionally add a fields...
//
if (StringUtils.isNotEmpty(responseCodeField)) {
ValueMetaInterface codeValue = new ValueMetaInteger(responseCodeField);
codeValue.setLength(3);
codeValue.setOrigin(name);
inputRowMeta.addValueMeta(codeValue);
}
if (StringUtils.isNotEmpty(responseTimeField)) {
ValueMetaInterface timeValue = new ValueMetaInteger(responseTimeField);
timeValue.setLength(7);
timeValue.setOrigin(name);
inputRowMeta.addValueMeta(timeValue);
}
}
示例5: setStepOutputInterface
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
/**
* This method will be used for setting the output interface.
* Output interface is how this step will process the row to next step
*/
private void setStepOutputInterface() {
ValueMetaInterface[] out = new ValueMetaInterface[measureCount + 1];
for (int i = 0; i < measureCount; i++) {
out[i] = new ValueMeta("measure" + i, ValueMetaInterface.TYPE_NUMBER,
ValueMetaInterface.STORAGE_TYPE_NORMAL);
out[i].setStorageMetadata(new ValueMeta("measure" + i, ValueMetaInterface.TYPE_NUMBER,
ValueMetaInterface.STORAGE_TYPE_NORMAL));
}
out[out.length - 1] = new ValueMeta("id", ValueMetaInterface.TYPE_BINARY,
ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
out[out.length - 1].setStorageMetadata(new ValueMeta("id", ValueMetaInterface.TYPE_STRING,
ValueMetaInterface.STORAGE_TYPE_NORMAL));
out[out.length - 1].setLength(256);
out[out.length - 1].setStringEncoding(CarbonCommonConstants.BYTE_ENCODING);
out[out.length - 1].getStorageMetadata().setStringEncoding(CarbonCommonConstants.BYTE_ENCODING);
data.outputRowMeta.setValueMetaList(Arrays.asList(out));
}
示例6: formatField
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
/**
* Takes an input field and converts it to bytes to be stored in the temp file.
* @param v The metadata about the column
* @param valueData The column data
* @return The bytes for the value
* @throws KettleValueException
*/
private byte[] formatField( ValueMetaInterface v, Object valueData ) throws KettleValueException {
if ( v.isString() ) {
if ( v.isStorageBinaryString() && v.getTrimType() == ValueMetaInterface.TRIM_TYPE_NONE && v.getLength() < 0
&& Const.isEmpty( v.getStringEncoding() ) ) {
return (byte[]) valueData;
} else {
String svalue = ( valueData instanceof String ) ? (String) valueData : v.getString( valueData );
// trim or cut to size if needed.
//
return convertStringToBinaryString( v, Const.trimToType( svalue, v.getTrimType() ) );
}
} else {
return v.getBinaryString( valueData );
}
}
示例7: prepareExecutionResultsArticle
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
private void prepareExecutionResultsArticle( RowMetaInterface inputRowMeta, VariableSpace space ) throws KettleStepException {
inputRowMeta.clear();
addFieldToRow( inputRowMeta, space.environmentSubstitute( getArticleIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getArticleUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getArticleTitleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getArticleBodyFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getAuthorIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCommentsDisabledFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLabelsFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getDraftFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPromotedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getVoteSumFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getVoteCountFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例8: prepareExecutionResultsTranslation
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
private void prepareExecutionResultsTranslation( RowMetaInterface inputRowMeta, VariableSpace space ) throws KettleStepException {
inputRowMeta.clear();
addFieldToRow( inputRowMeta, space.environmentSubstitute( getArticleIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationSourceIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationSourceTypeFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationTitleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationBodyFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationDraftFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationUpdatedByIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTranslationCreatedByIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
}
示例9: getFields
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldIdFieldname() ),
ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldUrlFieldname() ),
ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldTypeFieldname() ),
ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldTitleFieldname() ),
ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldActiveFieldname() ),
ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldRequiredFieldname() ),
ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldVisibleEndUsersFieldname() ),
ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例10: getFields
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionNameFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例11: prepareExecutionResultsTicketOverview
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
private void prepareExecutionResultsTicketOverview( RowMetaInterface inputRowMeta, VariableSpace space ) throws KettleStepException {
inputRowMeta.clear();
addFieldToRow( inputRowMeta, getTicketIdFieldname(), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getAuditIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getAuditRownumFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedTimeFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getOrganizationIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getRequesterIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getAssigneeIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getGroupIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSubjectFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getStatusFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPriorityFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getChannelFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTypeFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSatisfactionFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getDueAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSatisfactionCommentFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getFormIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getBrandIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
}
示例12: getFields
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryNameFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getDescriptionFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例13: getFields
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSuspendedTicketIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSuspendedTicketUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getAuthorFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSubjectFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getContentFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCauseFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getMessageIdFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getRecipientFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getViaFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getBrandIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
}
示例14: testAddFieldToRow
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
@Test
public void testAddFieldToRow() throws KettleStepException {
ZendeskInputMeta meta = new ZendeskInputUsersMeta();
RowMetaInterface row = new RowMeta();
assertTrue( row.isEmpty() );
meta.addFieldToRow( row, "field1", ValueMetaInterface.TYPE_STRING );
assertEquals( 1, row.size() );
assertEquals( "field1", row.getValueMeta( 0 ).getName() );
assertEquals( ValueMetaInterface.TYPE_STRING, row.getValueMeta( 0 ).getType() );
meta.addFieldToRow( row, "", ValueMetaInterface.TYPE_INTEGER );
assertEquals( 1, row.size() );
meta.addFieldToRow( row, null, ValueMetaInterface.TYPE_INTEGER );
assertEquals( 1, row.size() );
try {
meta.addFieldToRow( row, "field2", Integer.MIN_VALUE );
fail();
} catch( KettleStepException expected ) {
// OK
}
}
示例15: getRowForData
import org.pentaho.di.core.row.ValueMetaInterface; //导入依赖的package包/类
private Object[] getRowForData( TableItem item, int rowNr ) throws KettleException {
try {
Object[] row = RowDataUtil.allocateRowData( rowMeta.size() );
for ( int i = 0; i < rowMeta.size(); i++ ) {
ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );
ValueMetaInterface stringValueMeta = stringRowMeta.getValueMeta( i );
int colnr = i + 1;
if ( GUIResource.getInstance().getColorBlue().equals( item.getForeground( colnr ) ) ) {
row[i] = null; // <null> value
} else {
String string = item.getText( colnr );
row[i] = valueMeta.convertDataFromString( string, stringValueMeta,
null, null, ValueMetaInterface.TRIM_TYPE_NONE );
}
}
return row;
} catch ( KettleException e ) {
throw new KettleException( BaseMessages.getString( PKG, "EditRowsDialog.Error.ErrorGettingRowForData",
Integer.toString( rowNr ) ), e );
}
}