本文整理汇总了Java中org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta类的典型用法代码示例。如果您正苦于以下问题:Java TextFileOutputMeta类的具体用法?Java TextFileOutputMeta怎么用?Java TextFileOutputMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextFileOutputMeta类属于org.pentaho.di.trans.steps.textfileoutput包,在下文中一共展示了TextFileOutputMeta类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetPrevStepFields
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
@Test
public void testGetPrevStepFields() throws KettleStepException {
DataGridMeta dgm = new DataGridMeta();
dgm.allocate( 2 );
dgm.setFieldName( new String[]{ "id" } );
dgm.setFieldType( new String[]{ ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_INTEGER ) } );
List<List<String>> dgm1Data = new ArrayList<>();
dgm1Data.add( Collections.singletonList( "1" ) );
dgm1Data.add( Collections.singletonList( "2" ) );
dgm.setDataLines( dgm1Data );
StepMeta dg = new StepMeta( "input1", dgm );
TextFileOutputMeta textFileOutputMeta = new TextFileOutputMeta();
StepMeta textFileOutputStep = new StepMeta( "BACKLOG-21039", textFileOutputMeta );
TransHopMeta hop = new TransHopMeta( dg, textFileOutputStep, true );
transMeta.addStep( dg );
transMeta.addStep( textFileOutputStep );
transMeta.addTransHop( hop );
RowMetaInterface row = transMeta.getPrevStepFields( textFileOutputStep );
assertNotNull( row );
assertEquals( 1, row.size() );
assertEquals( "id", row.getValueMeta( 0 ).getName() );
assertEquals( ValueMetaInterface.TYPE_INTEGER, row.getValueMeta( 0 ).getType() );
dgm.setFieldName( new String[]{ "id", "name" } );
dgm.setFieldType( new String[]{
ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_INTEGER ),
ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING ),
} );
row = transMeta.getPrevStepFields( textFileOutputStep );
assertNotNull( row );
assertEquals( 2, row.size() );
assertEquals( "id", row.getValueMeta( 0 ).getName() );
assertEquals( "name", row.getValueMeta( 1 ).getName() );
assertEquals( ValueMetaInterface.TYPE_INTEGER, row.getValueMeta( 0 ).getType() );
assertEquals( ValueMetaInterface.TYPE_STRING, row.getValueMeta( 1 ).getType() );
}
示例2: TextFileOutputDialog
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
public TextFileOutputDialog(Shell parent, Object in, TransMeta transMeta, String sname)
{
super(parent, (BaseStepMeta)in, transMeta, sname);
input=(TextFileOutputMeta)in;
inputFields =new HashMap<String, Integer>();
}
示例3: getInfo
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
private void getInfo(TextFileOutputMeta tfoi)
{
tfoi.setFileName( wFilename.getText() );
tfoi.setFileAsCommand( wFileIsCommand.getSelection() );
tfoi.setDoNotOpenNewFileInit(wDoNotOpenNewFileInit.getSelection() );
tfoi.setFileFormat( wFormat.getText() );
tfoi.setFileCompression( wCompression.getText() );
tfoi.setEncoding( wEncoding.getText() );
tfoi.setSeparator( wSeparator.getText() );
tfoi.setEnclosure( wEnclosure.getText() );
tfoi.setExtension( wExtension.getText() );
tfoi.setSplitEvery( Const.toInt(wSplitEvery.getText(), 0) );
tfoi.setEndedLine( wEndedLine.getText() );
tfoi.setFileNameField( wFileNameField.getText() );
tfoi.setFileNameInField( wFileNameInField.getSelection() );
tfoi.setEnclosureForced( wEnclForced.getSelection() );
tfoi.setHeaderEnabled( wHeader.getSelection() );
tfoi.setFooterEnabled( wFooter.getSelection() );
tfoi.setFileAppended( wAppend.getSelection() );
tfoi.setStepNrInFilename( wAddStepnr.getSelection() );
tfoi.setPartNrInFilename( wAddPartnr.getSelection() );
tfoi.setDateInFilename( wAddDate.getSelection() );
tfoi.setTimeInFilename( wAddTime.getSelection() );
tfoi.setDateTimeFormat(wDateTimeFormat.getText());
tfoi.setSpecifyingFormat(wSpecifyFormat.getSelection());
tfoi.setPadded( wPad.getSelection() );
tfoi.setAddToResultFiles( wAddToResult.getSelection() );
tfoi.setFastDump( wFastDump.getSelection() );
int i;
//Table table = wFields.table;
int nrfields = wFields.nrNonEmpty();
tfoi.allocate(nrfields);
for (i=0;i<nrfields;i++)
{
TextFileField field = new TextFileField();
TableItem item = wFields.getNonEmpty(i);
field.setName( item.getText(1) );
field.setType( item.getText(2) );
field.setFormat( item.getText(3) );
field.setLength( Const.toInt(item.getText(4), -1) );
field.setPrecision( Const.toInt(item.getText(5), -1) );
field.setCurrencySymbol( item.getText(6) );
field.setDecimalSymbol( item.getText(7) );
field.setGroupingSymbol( item.getText(8) );
field.setTrimType( ValueMeta.getTrimTypeByDesc(item.getText(9)));
field.setNullString( item.getText(10) );
tfoi.getOutputFields()[i] = field;
}
}
示例4: getData
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData()
{
if (input.getFileName() != null) wFilename.setText(input.getFileName());
wFileIsCommand.setSelection(input.isFileAsCommand());
wServletOutput.setSelection(input.isServletOutput());
setFlagsServletOption();
wDoNotOpenNewFileInit.setSelection(input.isDoNotOpenNewFileInit());
wCreateParentFolder.setSelection(input.isCreateParentFolder());
wExtension.setText(Const.NVL(input.getExtension(), ""));
wSeparator.setText(Const.NVL(input.getSeparator(), ""));
wEnclosure.setText(Const.NVL(input.getEnclosure(), ""));
if (input.getFileFormat()!=null) {
wFormat.select(0); // default if not found: CR+LF
for (int i=0;i<TextFileOutputMeta.formatMapperLineTerminator.length;i++) {
if(input.getFileFormat().equals(TextFileOutputMeta.formatMapperLineTerminator[i])) wFormat.select(i);
}
}
if (input.getFileCompression()!=null) wCompression.setText(input.getFileCompression());
if (input.getEncoding() !=null) wEncoding.setText(input.getEncoding());
if (input.getEndedLine() !=null) wEndedLine.setText(input.getEndedLine());
wFileNameInField.setSelection(input.isFileNameInField());
if (input.getFileNameField() !=null) wFileNameField.setText(input.getFileNameField());
wSplitEvery.setText(""+input.getSplitEvery());
wEnclForced.setSelection(input.isEnclosureForced());
wDisableEnclosureFix.setSelection(input.isEnclosureFixDisabled());
wHeader.setSelection(input.isHeaderEnabled());
wFooter.setSelection(input.isFooterEnabled());
wAddDate.setSelection(input.isDateInFilename());
wAddTime.setSelection(input.isTimeInFilename());
wDateTimeFormat.setText(Const.NVL(input.getDateTimeFormat(), ""));
wSpecifyFormat.setSelection(input.isSpecifyingFormat());
wAppend.setSelection(input.isFileAppended());
wAddStepnr.setSelection(input.isStepNrInFilename());
wAddPartnr.setSelection(input.isPartNrInFilename());
wPad.setSelection(input.isPadded());
wFastDump.setSelection(input.isFastDump());
wAddToResult.setSelection(input.isAddToResultFiles());
logDebug("getting fields info...");
for (int i=0;i<input.getOutputFields().length;i++)
{
TextFileField field = input.getOutputFields()[i];
TableItem item = wFields.table.getItem(i);
if (field.getName()!=null) item.setText(1, field.getName());
item.setText(2, field.getTypeDesc());
if (field.getFormat()!=null) item.setText(3, field.getFormat());
if (field.getLength()>=0) item.setText(4, ""+field.getLength());
if (field.getPrecision()>=0) item.setText(5, ""+field.getPrecision());
if (field.getCurrencySymbol()!=null) item.setText(6, field.getCurrencySymbol());
if (field.getDecimalSymbol()!=null) item.setText(7, field.getDecimalSymbol());
if (field.getGroupingSymbol()!=null) item.setText(8, field.getGroupingSymbol());
String trim = field.getTrimTypeDesc();
if (trim != null) item.setText(9, trim);
if (field.getNullString()!=null) item.setText(10, field.getNullString());
}
wFields.optWidth(true);
wStepname.selectAll();
}
示例5: getInfo
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
private void getInfo(TextFileOutputMeta tfoi)
{
tfoi.setFileName( wFilename.getText() );
tfoi.setFileAsCommand( wFileIsCommand.getSelection() );
tfoi.setServletOutput(wServletOutput.getSelection() );
tfoi.setCreateParentFolder(wCreateParentFolder.getSelection() );
tfoi.setDoNotOpenNewFileInit(wDoNotOpenNewFileInit.getSelection() );
tfoi.setFileFormat( TextFileOutputMeta.formatMapperLineTerminator[wFormat.getSelectionIndex()] );
tfoi.setFileCompression( wCompression.getText() );
tfoi.setEncoding( wEncoding.getText() );
tfoi.setSeparator( wSeparator.getText() );
tfoi.setEnclosure( wEnclosure.getText() );
tfoi.setExtension( wExtension.getText() );
tfoi.setSplitEvery( Const.toInt(wSplitEvery.getText(), 0) );
tfoi.setEndedLine( wEndedLine.getText() );
tfoi.setFileNameField( wFileNameField.getText() );
tfoi.setFileNameInField( wFileNameInField.getSelection() );
tfoi.setEnclosureForced( wEnclForced.getSelection() );
tfoi.setEnclosureFixDisabled( wDisableEnclosureFix.getSelection() );
tfoi.setHeaderEnabled( wHeader.getSelection() );
tfoi.setFooterEnabled( wFooter.getSelection() );
tfoi.setFileAppended( wAppend.getSelection() );
tfoi.setStepNrInFilename( wAddStepnr.getSelection() );
tfoi.setPartNrInFilename( wAddPartnr.getSelection() );
tfoi.setDateInFilename( wAddDate.getSelection() );
tfoi.setTimeInFilename( wAddTime.getSelection() );
tfoi.setDateTimeFormat(wDateTimeFormat.getText());
tfoi.setSpecifyingFormat(wSpecifyFormat.getSelection());
tfoi.setPadded( wPad.getSelection() );
tfoi.setAddToResultFiles( wAddToResult.getSelection() );
tfoi.setFastDump( wFastDump.getSelection() );
int i;
//Table table = wFields.table;
int nrfields = wFields.nrNonEmpty();
tfoi.allocate(nrfields);
for (i=0;i<nrfields;i++)
{
TextFileField field = new TextFileField();
TableItem item = wFields.getNonEmpty(i);
field.setName( item.getText(1) );
field.setType( item.getText(2) );
field.setFormat( item.getText(3) );
field.setLength( Const.toInt(item.getText(4), -1) );
field.setPrecision( Const.toInt(item.getText(5), -1) );
field.setCurrencySymbol( item.getText(6) );
field.setDecimalSymbol( item.getText(7) );
field.setGroupingSymbol( item.getText(8) );
field.setTrimType( ValueMeta.getTrimTypeByDesc(item.getText(9)));
field.setNullString( item.getText(10) );
tfoi.getOutputFields()[i] = field;
}
}
示例6: getData
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData()
{
if (input.getFileName() != null) wFilename.setText(input.getFileName());
wFileIsCommand.setSelection(input.isFileAsCommand());
wServletOutput.setSelection(input.isServletOutput());
setFlagsServletOption();
wDoNotOpenNewFileInit.setSelection(input.isDoNotOpenNewFileInit());
wCreateParentFolder.setSelection(input.isCreateParentFolder());
wExtension.setText(Const.NVL(input.getExtension(), ""));
wSeparator.setText(Const.NVL(input.getSeparator(), ""));
wEnclosure.setText(Const.NVL(input.getEnclosure(), ""));
if (input.getFileFormat()!=null) {
wFormat.select(0); // default if not found: CR+LF
for (int i=0;i<TextFileOutputMeta.formatMapperLineTerminator.length;i++) {
if(input.getFileFormat().equalsIgnoreCase(TextFileOutputMeta.formatMapperLineTerminator[i])) wFormat.select(i);
}
}
if (input.getFileCompression()!=null) wCompression.setText(input.getFileCompression());
if (input.getEncoding() !=null) wEncoding.setText(input.getEncoding());
if (input.getEndedLine() !=null) wEndedLine.setText(input.getEndedLine());
wFileNameInField.setSelection(input.isFileNameInField());
if (input.getFileNameField() !=null) wFileNameField.setText(input.getFileNameField());
wSplitEvery.setText(""+input.getSplitEvery());
wEnclForced.setSelection(input.isEnclosureForced());
wDisableEnclosureFix.setSelection(input.isEnclosureFixDisabled());
wHeader.setSelection(input.isHeaderEnabled());
wFooter.setSelection(input.isFooterEnabled());
wAddDate.setSelection(input.isDateInFilename());
wAddTime.setSelection(input.isTimeInFilename());
wDateTimeFormat.setText(Const.NVL(input.getDateTimeFormat(), ""));
wSpecifyFormat.setSelection(input.isSpecifyingFormat());
wAppend.setSelection(input.isFileAppended());
wAddStepnr.setSelection(input.isStepNrInFilename());
wAddPartnr.setSelection(input.isPartNrInFilename());
wPad.setSelection(input.isPadded());
wFastDump.setSelection(input.isFastDump());
wAddToResult.setSelection(input.isAddToResultFiles());
logDebug("getting fields info...");
for (int i=0;i<input.getOutputFields().length;i++)
{
TextFileField field = input.getOutputFields()[i];
TableItem item = wFields.table.getItem(i);
if (field.getName()!=null) item.setText(1, field.getName());
item.setText(2, field.getTypeDesc());
if (field.getFormat()!=null) item.setText(3, field.getFormat());
if (field.getLength()>=0) item.setText(4, ""+field.getLength());
if (field.getPrecision()>=0) item.setText(5, ""+field.getPrecision());
if (field.getCurrencySymbol()!=null) item.setText(6, field.getCurrencySymbol());
if (field.getDecimalSymbol()!=null) item.setText(7, field.getDecimalSymbol());
if (field.getGroupingSymbol()!=null) item.setText(8, field.getGroupingSymbol());
String trim = field.getTrimTypeDesc();
if (trim != null) item.setText(9, trim);
if (field.getNullString()!=null) item.setText(10, field.getNullString());
}
wFields.optWidth(true);
wStepname.selectAll();
}
示例7: TextFileOutputDialog
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
public TextFileOutputDialog( Shell parent, Object in, TransMeta transMeta, String sname ) {
super( parent, (BaseStepMeta) in, transMeta, sname );
input = (TextFileOutputMeta) in;
inputFields = new HashMap<String, Integer>();
}
示例8: saveInfoInMeta
import org.pentaho.di.trans.steps.textfileoutput.TextFileOutputMeta; //导入依赖的package包/类
private void saveInfoInMeta( TextFileOutputMeta tfoi ) {
tfoi.setFileName( wFilename.getText() );
tfoi.setFileAsCommand( wFileIsCommand.getSelection() );
tfoi.setServletOutput( wServletOutput.getSelection() );
tfoi.setCreateParentFolder( wCreateParentFolder.getSelection() );
tfoi.setDoNotOpenNewFileInit( wDoNotOpenNewFileInit.getSelection() );
tfoi.setFileFormat( TextFileOutputMeta.formatMapperLineTerminator[wFormat.getSelectionIndex()] );
tfoi.setFileCompression( wCompression.getText() );
tfoi.setEncoding( wEncoding.getText() );
tfoi.setSeparator( wSeparator.getText() );
tfoi.setEnclosure( wEnclosure.getText() );
tfoi.setExtension( wExtension.getText() );
tfoi.setSplitEvery( Const.toInt( wSplitEvery.getText(), 0 ) );
tfoi.setEndedLine( wEndedLine.getText() );
tfoi.setFileNameField( wFileNameField.getText() );
tfoi.setFileNameInField( wFileNameInField.getSelection() );
tfoi.setEnclosureForced( wEnclForced.getSelection() );
tfoi.setEnclosureFixDisabled( wDisableEnclosureFix.getSelection() );
tfoi.setHeaderEnabled( wHeader.getSelection() );
tfoi.setFooterEnabled( wFooter.getSelection() );
tfoi.setFileAppended( wAppend.getSelection() );
tfoi.setStepNrInFilename( wAddStepnr.getSelection() );
tfoi.setPartNrInFilename( wAddPartnr.getSelection() );
tfoi.setDateInFilename( wAddDate.getSelection() );
tfoi.setTimeInFilename( wAddTime.getSelection() );
tfoi.setDateTimeFormat( wDateTimeFormat.getText() );
tfoi.setSpecifyingFormat( wSpecifyFormat.getSelection() );
tfoi.setPadded( wPad.getSelection() );
tfoi.setAddToResultFiles( wAddToResult.getSelection() );
tfoi.setFastDump( wFastDump.getSelection() );
int i;
// Table table = wFields.table;
int nrfields = wFields.nrNonEmpty();
tfoi.allocate( nrfields );
for ( i = 0; i < nrfields; i++ ) {
TextFileField field = new TextFileField();
TableItem item = wFields.getNonEmpty( i );
field.setName( item.getText( 1 ) );
field.setType( item.getText( 2 ) );
field.setFormat( item.getText( 3 ) );
field.setLength( Const.toInt( item.getText( 4 ), -1 ) );
field.setPrecision( Const.toInt( item.getText( 5 ), -1 ) );
field.setCurrencySymbol( item.getText( 6 ) );
field.setDecimalSymbol( item.getText( 7 ) );
field.setGroupingSymbol( item.getText( 8 ) );
field.setTrimType( ValueMetaString.getTrimTypeByDesc( item.getText( 9 ) ) );
field.setNullString( item.getText( 10 ) );
//CHECKSTYLE:Indentation:OFF
tfoi.getOutputFields()[i] = field;
}
}