本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.getFieldNames方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.getFieldNames方法的具體用法?Java RowMetaInterface.getFieldNames怎麽用?Java RowMetaInterface.getFieldNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.core.row.RowMetaInterface
的用法示例。
在下文中一共展示了RowMetaInterface.getFieldNames方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: get
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void get() {
if(!gotPreviousFields)
{
try {
String columnName = wFieldName.getText();
wFieldName.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
r.getFieldNames();
for (int i = 0; i < r.getFieldNames().length; i++) {
wFieldName.add(r.getFieldNames()[i]);
}
}
wFieldName.setText(columnName);
gotPreviousFields=true;
} catch (KettleException ke) {
new ErrorDialog(shell, Messages.getString("CreditCardValidatorDialog.FailedToGetFields.DialogTitle"), Messages.getString("CreditCardValidatorDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
示例2: getPreviousFieldNames
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void getPreviousFieldNames()
{
if(!gotPreviousFields)
{
try
{
String keyValue=wKeyField.getText();
wKeyField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
r.getFieldNames();
for (int i = 0; i < r.getFieldNames().length; i++) {
wKeyField.add(r.getFieldNames()[i]);
}
}
if(keyValue!=null) wKeyField.setText(keyValue);
gotPreviousFields=true;
}
catch(KettleException ke)
{
new ErrorDialog(shell, BaseMessages.getString(PKG, "DenormaliserDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "DenormaliserDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
示例3: setFileField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setFileField()
{
try{
String field= wFilenameField.getText();
wFilenameField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r!=null)
{
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++)
{
wFilenameField.add(r.getFieldNames()[i]);
}
}
if(field!=null) wFilenameField.setText(field);
}catch(KettleException ke){
new ErrorDialog(shell, BaseMessages.getString(PKG, "AccessInputDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "AccessInputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例4: setFileField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setFileField()
{
try{
wFilenameField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r!=null)
{
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++)
{
wFilenameField.add(r.getFieldNames()[i]);
}
}
}catch(KettleException ke){
new ErrorDialog(shell, BaseMessages.getString(PKG, "GetFilesRowsCountDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "GetFilesRowsCountDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例5: setFileField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setFileField(){
try{
wFileNameField.removeAll();
if(!Const.isEmpty(wAccStep.getText())){
RowMetaInterface r = transMeta.getStepFields(wAccStep.getText());
if (r!=null){
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++){
wFileNameField.add(r.getFieldNames()[i]);
}
}
}
}catch(KettleException ke){
new ErrorDialog(shell, Messages.getString("KMLFileInputDialog.FailedToGetFields.DialogTitle"), Messages.getString("KMLFileInputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例6: setXMLStreamField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setXMLStreamField()
{
try{
wXMLField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r!=null)
{
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++)
{
wXMLField.add(r.getFieldNames()[i]);
}
}
}catch(KettleException ke){
new ErrorDialog(shell, Messages.getString("GetXMLDataDialog.FailedToGetFields.DialogTitle"), Messages.getString("GetXMLDataDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例7: setURLPreviousField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setURLPreviousField()
{
try{
wUrlField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r!=null)
{
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++)
{
wUrlField.add(r.getFieldNames()[i]);
}
}
}catch(KettleException ke){
new ErrorDialog(shell, BaseMessages.getString(PKG, "RssInputDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "RssInputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例8: setFileField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setFileField(){
try{
wFileNameField.removeAll();
if(!Const.isEmpty(wAccStep.getText())){
RowMetaInterface r = transMeta.getStepFields(wAccStep.getText());
if (r!=null){
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++){
wFileNameField.add(r.getFieldNames()[i]);
}
}
}
}catch(KettleException ke){
new ErrorDialog(shell, Messages.getString("GISFileOutputDialog.FailedToGetFields.DialogTitle"), Messages.getString("GISFileOutputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例9: generateFieldMapping
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
/**
* Create a new field mapping between source and target steps.
*
* @param shell the shell of the parent window
* @param sourceFields the source fields
* @param targetFields the target fields
* @param fieldMapping the list of source to target mappings to default to (can be empty but not null)
*
* @throws KettleException in case something goes wrong during the field mapping
*
*/
public static final void generateFieldMapping(Shell shell, RowMetaInterface sourceFields, RowMetaInterface targetFields, List<SourceToTargetMapping> fieldMapping) throws KettleException {
// Build the mapping: let the user decide!!
String[] source = sourceFields.getFieldNames();
for (int i = 0; i < source.length; i++) {
ValueMetaInterface v = sourceFields.getValueMeta(i);
source[i] += EnterMappingDialog.STRING_ORIGIN_SEPARATOR + v.getOrigin() + ")";
}
String[] target = targetFields.getFieldNames();
EnterMappingDialog dialog = new EnterMappingDialog(shell, source, target, fieldMapping);
List<SourceToTargetMapping> newMapping = dialog.open();
if (newMapping!=null) {
fieldMapping.clear();
fieldMapping.addAll(newMapping);
}
}
示例10: setFileField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setFileField()
{
try{
String field= wFilenameField.getText();
wFilenameField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r!=null)
{
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++)
{
wFilenameField.add(r.getFieldNames()[i]);
}
}
if(field!=null) wFilenameField.setText(field);
}catch(KettleException ke){
new ErrorDialog(shell, Messages.getString("AccessInputDialog.FailedToGetFields.DialogTitle"), Messages.getString("AccessInputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例11: setFileField
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void setFileField()
{
try{
String value= wFilenameField.getText();
wFilenameField.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r!=null)
{
r.getFieldNames();
for (int i=0;i<r.getFieldNames().length;i++)
{
wFilenameField.add(r.getFieldNames()[i]);
}
}
if(value!=null) wFilenameField.setText(value);
}catch(KettleException ke){
new ErrorDialog(shell, Messages.getString("PropertyInputDialog.FailedToGetFields.DialogTitle"), Messages.getString("PropertyInputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例12: get
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private void get() {
if(!gotPreviousFields)
{
try {
String columnName = wFieldName.getText();
wFieldName.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
r.getFieldNames();
for (int i = 0; i < r.getFieldNames().length; i++) {
wFieldName.add(r.getFieldNames()[i]);
}
}
wFieldName.setText(columnName);
gotPreviousFields=true;
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "CreditCardValidatorDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "CreditCardValidatorDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
示例13: checkFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
void checkFields( RowMetaInterface rmi, List<SequoiaDBOutputFieldInfo> fields ) throws KettleException {
// check if match input fields
if ( rmi.getFieldNames().length <= 0 ) {
throw new KettleException( BaseMessages.getString( PKG,
"SequoiaDBOutput.Msg.Err.InputFieldsSizeError" )) ;
}
if( fields.size() <= 0 ){
throw new KettleException( BaseMessages.getString( PKG,
"SequoiaDBOutput.Msg.Err.OutputFieldsEmpty" )) ;
}
Set<String> input = new HashSet<String>( rmi.getFieldNames().length, 1 ) ;
Set<String> output = new HashSet<String>( fields.size(), 1 ) ;
for( int i = 0; i < rmi.size(); i++ ) {
input.add( rmi.getValueMeta( i ).getName() );
}
for( int j = 0; j < fields.size(); j++ ){
output.add( fields.get(j).getName() ) ;
}
if ( !input.containsAll( output )) {
output.removeAll( input ) ;
StringBuffer loseFields = new StringBuffer() ;
for( String name : output ) {
loseFields.append( "'" ).append( name ).append( "', ") ;
}
throw new KettleException( BaseMessages.getString( PKG,
"SequoiaDBOutput.Msg.Err.FieldsNotFoundInInput", loseFields.toString() ));
}
}
示例14: safeModeChecking
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
protected void safeModeChecking(RowMetaInterface row) throws KettleRowException
{
if (row==null) {
return;
}
if (inputReferenceRow == null)
{
inputReferenceRow = row.clone(); // copy it!
// Check for double field names.
//
String[] fieldnames = row.getFieldNames();
Arrays.sort(fieldnames);
for (int i=0;i<fieldnames.length-1;i++)
{
if (fieldnames[i].equals(fieldnames[i+1]))
{
throw new KettleRowException(Messages.getString("BaseStep.SafeMode.Exception.DoubleFieldnames", fieldnames[i]));
}
}
}
else
{
safeModeChecking(inputReferenceRow, row);
}
}
示例15: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
// re-assemble a new row of metadata
//
RowMetaInterface fields = new RowMeta();
// Add existing values
fields.addRowMeta(r);
// add analytic values
for (int i = 0 ; i < number_of_fields; i ++ ){
int index_of_subject = -1;
index_of_subject = r.indexOfValue(subjectField[i]);
// if we found the subjectField in the RowMetaInterface, and we should....
if (index_of_subject > -1) {
ValueMetaInterface vmi = r.getValueMeta(index_of_subject).clone();
vmi.setOrigin(origin);
vmi.setName(aggregateField[i]);
fields.addValueMeta(r.size() + i, vmi);
}
else {
// we have a condition where the subjectField can't be found from the rowMetaInterface
StringBuilder sbfieldNames = new StringBuilder();
String[] fieldNames = r.getFieldNames();
for (int j=0; j < fieldNames.length; j++) {
sbfieldNames.append("["+fieldNames[j]+"]"+(j<fieldNames.length-1?", ":""));
}
throw new KettleStepException(BaseMessages.getString(PKG, "AnalyticQueryMeta.Exception.SubjectFieldNotFound", getParentStepMeta().getName(), subjectField[i], sbfieldNames.toString()));
}
}
r.clear();
// Add back to Row Meta
r.addRowMeta(fields);
}